no message

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1047 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2007-05-31 22:20:41 +00:00
parent ac5e877a49
commit bb493dcac8
3 changed files with 15 additions and 21 deletions
+2 -2
View File
@@ -100,7 +100,7 @@ COMMANDN(team, newteam, ARG_1STR);
COMMANDN(name, newname, ARG_1STR);
COMMANDN(skin, newskin, ARG_1INT);
extern void throw_nade(playerent *d, const vec &vel, bounceent *p);
extern void thrownade(playerent *d, const vec &vel, bounceent *p);
void deathstate(playerent *pl)
{
@@ -111,7 +111,7 @@ void deathstate(playerent *pl)
pl->roll = 60;
pl->strafe = 0;
dblend = 0;
if(pl == player1 && pl->inhandnade) throw_nade(pl, vec(0,0,0), pl->inhandnade);
if(pl == player1 && pl->inhandnade) thrownade(pl, vec(0,0,0), pl->inhandnade);
}
void spawnstate(playerent *d) // reset player state not persistent accross spawns
+2 -2
View File
@@ -137,7 +137,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
}
case SV_SOUND:
playsound(getint(p), !d || (demoplayback && cn == democlientnum) ? NULL : &d->o);
playsound(getint(p), !d || localdemoplayer1st() ? NULL : &d->o);
break;
@@ -287,7 +287,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
conoutf("\f2%s suicided", d->name);
act = d;
}
else if(actor==getclientnum() || (demoplayback && actor==democlientnum))
else if(actor==getclientnum() /*|| (demoplayback && actor==democlientnum)*/) // player-neutral gameplay messages?
{
act = player1;
int frags;
+11 -17
View File
@@ -450,17 +450,13 @@ void addgib(playerent *d)
}
}
void throw_nade(playerent *d, const vec &vel, bounceent *p)
void thrownade(playerent *d, const vec &vel, bounceent *p)
{
if(!p || !d) return;
playsound(S_GRENADETHROW);
vec throwvel(vel);
throwvel.mul(2*d->radius);
if(!d || !p) return;
vec dir(vel);
dir.mul(1.1f*d->radius);
p->vel = vel;
p->o.add(throwvel);
p->o.mul(1.5f);
p->o.add(dir);
p->o.add(d->o);
p->bouncestate = NADE_THROWED;
@@ -474,15 +470,13 @@ void throw_nade(playerent *d, const vec &vel, bounceent *p)
}
}
void throw_nade(playerent *d, bounceent *p)
void thrownade(playerent *d, bounceent *p)
{
if(!d || !p) return;
const float speed = cosf(RAD*d->pitch);
vec vel(sinf(RAD*d->yaw)*speed, -cosf(RAD*d->yaw)*speed, sinf(RAD*d->pitch));
vel.mul(1.5f);
throw_nade(d, vel, p);
vel.mul(1.5f);
thrownade(d, vel, p);
}
// fixme release
@@ -508,7 +502,7 @@ bounceent *new_nade(playerent *d, int millis = 0)
void explode_nade(bounceent *i)
{
if(!i) return;
if(i->bouncestate != NADE_THROWED) throw_nade(i->owner, vec(0,0,0), i);
if(i->bouncestate != NADE_THROWED) thrownade(i->owner, vec(0,0,0), i);
playsound(S_FEXPLODE, &i->o);
newprojectile(i->o, i->o, 1, i->owner==player1, i->owner, GUN_GRENADE);
}
@@ -547,7 +541,7 @@ void shootv(int gun, vec &from, vec &to, playerent *d, bool local, int nademilli
if(d!=player1 || demoplayback)
{
bounceent *p = new_nade(d, nademillis);
throw_nade(d, to, p);
thrownade(d, to, p);
}
break;
}
@@ -718,7 +712,7 @@ void shoot(playerent *d, vec &targ)
d->lastaction = lastmillis;
d->lastattackgun = d->gunselect;
}
else if(!d->attacking && d->inhandnade && attacktime>grenadepulltime) throw_nade(d, d->inhandnade);
else if(!d->attacking && d->inhandnade && attacktime>grenadepulltime) thrownade(d, d->inhandnade);
return;
}
else