no message
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@774 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -612,7 +612,7 @@ void suicide()
|
||||
|
||||
COMMAND(suicide, ARG_NONE);
|
||||
|
||||
// EDIT: AH
|
||||
|
||||
void flagaction(int flag, int action)
|
||||
{
|
||||
flaginfo &f = flaginfos[flag];
|
||||
|
||||
@@ -430,8 +430,9 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
|
||||
f.flag->y = (ushort) (getint(p)/DMF);
|
||||
f.flag->z = (ushort) (getint(p)/DMF);
|
||||
f.flag->z -= 4;
|
||||
|
||||
float floor = (float)S(f.flag->x, f.flag->y)->floor;
|
||||
sqr *dropplace = S_SECURE(f.flag->x, f.flag->y);
|
||||
if(!dropplace) return;
|
||||
float floor = (float)dropplace->floor;
|
||||
if(f.flag->z > hdr.waterlevel) // above water
|
||||
{
|
||||
if(floor < hdr.waterlevel)
|
||||
@@ -521,24 +522,3 @@ void localservertoclient(int chan, uchar *buf, int len) // processes any updat
|
||||
break;
|
||||
};
|
||||
};
|
||||
|
||||
void test1(int x, int y)
|
||||
{
|
||||
conoutf("mipsize %i", mipsize);
|
||||
conoutf("world : %i %i %i", sizeof(world), sizeof(world[0]), sizeof(&world) / sizeof(world[0]));
|
||||
|
||||
sqr *q = S_SECURE(x, y);
|
||||
if(q)
|
||||
conoutf("%i\n", q->floor);
|
||||
else conoutf("invalid!");
|
||||
};
|
||||
|
||||
COMMAND(test1, ARG_2INT);
|
||||
|
||||
void test2()
|
||||
{
|
||||
conoutf("%f %f %f", player1->o.x, player1->o.y, (float) S((ushort)(player1->o.x), (ushort)(player1->o.y))->floor);
|
||||
};
|
||||
|
||||
COMMAND(test2, ARG_NONE);
|
||||
|
||||
|
||||
@@ -240,14 +240,18 @@ void newprojectile(vec &from, vec &to, float speed, bool local, playerent *owner
|
||||
|
||||
void hit(int target, int damage, playerent *d, playerent *at, bool gib=false)
|
||||
{
|
||||
d->lastpain = lastmillis;
|
||||
if(m_ctf && isteam(d->team, at->team))
|
||||
{
|
||||
flaginfo &enemyflag = flaginfos[team_opposite(team_int(d->team))];
|
||||
if(enemyflag.state == CTFF_STOLEN && enemyflag.actor == d) return; // protect flag stealer from friendly-fire
|
||||
};
|
||||
d->lastpain = lastmillis;
|
||||
if(d==player1 || d->type==ENT_BOT) selfdamage(damage, -1, at, gib, d);
|
||||
else
|
||||
{
|
||||
addmsg(gib ? SV_GIBDAMAGE : SV_DAMAGE, "ri3", target, damage, d->lifesequence);
|
||||
playsound(S_PAIN1+rnd(5), &d->o);
|
||||
};
|
||||
|
||||
particle_splash(3, damage, 1000, d->o);
|
||||
demodamage(damage, d->o);
|
||||
};
|
||||
@@ -424,7 +428,6 @@ void shootv(int gun, vec &from, vec &to, playerent *d, bool local, int nademilli
|
||||
case GUN_ASSAULT:
|
||||
addshotline(d, from, to);
|
||||
particle_splash(0, 5, 250, to);
|
||||
//particle_trail(1, 10, from, to);
|
||||
break;
|
||||
|
||||
case GUN_GRENADE:
|
||||
@@ -635,7 +638,7 @@ void shoot(playerent *d, vec &targ)
|
||||
else d->gunwait = guns[d->gunselect].attackdelay;
|
||||
|
||||
shootv(d->gunselect, from, to, d, 0);
|
||||
if(d->type==ENT_PLAYER) addmsg(SV_SHOT, "ri8", d->gunselect, (int)(from.x*DMF), (int)(from.y*DMF), (int)(from.z*DMF), (int)(to.x*DMF), (int)(to.y*DMF), (int)(to.z*DMF), 0 );
|
||||
if(d->type==ENT_PLAYER) addmsg(SV_SHOT, "ri8", d->gunselect, (int)(from.x*DMF), (int)(from.y*DMF), (int)(from.z*DMF), (int)(to.x*DMF), (int)(to.y*DMF), (int)(to.z*DMF), 0);
|
||||
|
||||
if(autoreload && d == player1 && !d->mag[d->gunselect]) reload(d);
|
||||
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ 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) < sizeof(world) / sizeof(world[0]) ? S(x,y) : NULL) // same as above, but validates coords
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user