no message

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1004 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2007-05-16 20:48:25 +00:00
parent 017d1c1d45
commit b8df666851
4 changed files with 13 additions and 16 deletions
+5 -14
View File
@@ -382,20 +382,11 @@ void flagstolen(int flag, int action, int act)
void flagdropped(int flag, int action, short x, short y, short z)
{
flaginfo &f = flaginfos[flag];
sqr *dropplace = S_SECURE(x, y);
if(!dropplace) return;
z -= 4;
float floor = (float) dropplace->floor;
if(z > hdr.waterlevel) // above water
{
if(floor < hdr.waterlevel) z = hdr.waterlevel; // avoid dropping into water
else z = (short) floor;
}
f.flag->x = x;
f.flag->y = y;
f.flag->z = z;
if(OUTBORD(x, y)) return;
f.flag->x = x;
f.flag->y = y;
f.flag->z = (short)floor(x, y);
if(f.flag->z < hdr.waterlevel) f.flag->z = (short) hdr.waterlevel;
f.flag->spawned = true;
f.ack = true;
flagmsg(flag, action);
+7 -1
View File
@@ -212,6 +212,12 @@ bool collide(physent *d, bool spawn, float drop, float rise)
return true;
}
float floor(short x, short y)
{
sqr *s = S(x, y);
return s->type == FHF ? s->floor-(s->vdelta+S(x+1,y)->vdelta+S(x,y+1)->vdelta+S(x+1,y+1)->vdelta)/16.0f : s->floor;
}
VARP(maxroll, 0, 0, 20);
// main physics routine, moves a player/monster for a curtime step
@@ -264,7 +270,7 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
d.x = (float)(move*cosf(RAD*(pl->yaw-90)));
d.y = (float)(move*sinf(RAD*(pl->yaw-90)));
d.z = (float)pl->type==ENT_BOUNCE ? pl->vel.z : 0;
d.z = 0.0f;
if(floating || water)
{
+1
View File
@@ -240,6 +240,7 @@ extern void entinmap(physent *d);
extern void physicsframe();
extern void mousemove(int dx, int dy);
extern void fixcamerarange(physent *cam = camera1);
extern float floor(short x, short y);
// sound
extern void playsound(int n, vec *loc = 0);
-1
View File
@@ -50,7 +50,6 @@ struct header // map file format header
#define SWS(w,x,y,s) (&(w)[(y)*(s)+(x)])
#define SW(w,x,y) SWS(w,x,y,ssize)
#define S(x,y) SW(world,x,y) // convenient lookup of a lowest mip cube
#define S_SECURE(x, y) ((y)*ssize+(x)<=mipsize ? S(x,y) : NULL) // same as above, but validates coords
#define SMALLEST_FACTOR 6 // determines number of mips there can be
#define DEFAULT_FACTOR 8
#define LARGEST_FACTOR 11 // 10 is already insane