From bb493dcac81f51dfdd631a375254ceb77d66bff6 Mon Sep 17 00:00:00 2001 From: driAn Date: Thu, 31 May 2007 22:20:41 +0000 Subject: [PATCH] no message git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1047 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 4 ++-- source/src/clients2c.cpp | 4 ++-- source/src/weapon.cpp | 28 +++++++++++----------------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 286c32d0..c33e2780 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -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 diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index 79562643..d33256f3 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -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; diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index dbaec8fc..3974e953 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -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