1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
--- common/wl_agent.c.orig 2003-09-11 20:39:02.674298800 +0200
+++ common/wl_agent.c 2003-09-11 20:42:17.229721880 +0200
@@ -919,32 +919,31 @@
viewdist = 0x7fffffffl;
closest = NULL;
-// while (1)
+ while (1)
{
oldclosest = closest;
for (check=ob->next ; check ; check=check->next)
if ((check->flags & FL_SHOOTABLE)
- //&&
+ &&
// (check->flags & FL_VISABLE) &&
-// (abs(check->viewx - centerx) < shootdelta)
+ (abs(check->viewx - centerx) < shootdelta)
)
-// {
+ {
if (CheckLine(check))
-// if (check->transx < viewdist)
+ if (check->transx < viewdist)
{
-// viewdist = check->transx;
+ viewdist = check->transx;
closest = check;
- break;
}
-// }
+ }
if (closest == oldclosest)
return; // no more targets, all missed
// trace a line from player to enemey
-// if (CheckLine(closest))
-// break;
+ if (CheckLine(closest))
+ break;
}
// hit something
--- common/wl_draw.c.orig 2003-09-11 20:43:26.473195272 +0200
+++ common/wl_draw.c 2003-09-11 20:46:57.859059736 +0200
@@ -877,7 +877,7 @@
tilespot = &tilemap[0][0]+spotloc;
// could be in any of the nine surrounding tiles
- if ((*visspot) ||
+ if (1 || (*visspot) ||
(*(visspot-1) && !*(tilespot-1)) ||
(*(visspot+1) && !*(tilespot+1)) ||
(*(visspot-65) && !*(tilespot-65)) ||
@@ -980,6 +980,8 @@
for (obj = player->next; obj; obj = obj->next)
{
+ int sprite;
+
if (!areabyplayer[obj->areanumber])
continue;
if (!gamestates[obj->state].shapenum)
@@ -989,10 +991,14 @@
glTranslated((float)obj->x/(1<<16), (float)obj->y/(1<<16), 0);
glRotated(-player->angle, 0,0,1);
- if (texture_index[PMSpriteStart+gamestates[obj->state].shapenum] == 0)
- CreateSprite(PMSpriteStart+gamestates[obj->state].shapenum);
+ sprite = gamestates[obj->state].shapenum;
+ if (gamestates[obj->state].rotate)
+ sprite += CalcRotate(obj);
+
+ if (texture_index[PMSpriteStart+sprite] == 0)
+ CreateSprite(PMSpriteStart+sprite);
else
- glBindTexture(GL_TEXTURE_2D, texture_index[PMSpriteStart+gamestates[obj->state].shapenum]);
+ glBindTexture(GL_TEXTURE_2D, texture_index[PMSpriteStart+sprite]);
glBegin(GL_QUADS);
glTexCoord2f(0,0);
|