From d2fe51c0f82d45c5f0a7dfcc936814d620d3f578 Mon Sep 17 00:00:00 2001 From: Rafael Barreto Date: Fri, 2 Jul 2010 21:47:46 +0000 Subject: [PATCH] fix singleplayer frag-gibs and the old head shot sound bug (thanks to Kirin for the tip) git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5267 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 6 +++--- source/src/weapon.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 48c82615..ff4a8ea7 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -652,7 +652,7 @@ void dodamage(int damage, playerent *pl, playerent *actor, bool gib, bool local) } damageeffect(damage, pl); - if(pl->health<=0) { if(local) dokill(pl, actor, gib, pl->weaponsel->type); } + if(pl->health<=0) { if(local) dokill(pl, actor, gib, actor->weaponsel->type); } else if(pl==player1) audiomgr.playsound(S_PAIN6, SP_HIGH); else audiomgr.playsound(S_PAIN1+rnd(5), pl); } @@ -682,14 +682,14 @@ void dokill(playerent *pl, playerent *act, bool gib, int gun) if(gib) { - if(pl!=act && /*act->weaponsel->type*/ gun == GUN_SNIPER) audiomgr.playsound(S_HEADSHOT, SP_LOW); + if(pl!=act && gun == GUN_SNIPER) audiomgr.playsound(S_HEADSHOT, SP_LOW); addgib(pl); } if(!m_mp(gamemode)) { if(pl==act || isteam(pl->team, act->team)) act->frags--; - else act->frags += gib ? 2 : 1; + else act->frags += ( gib && gun != GUN_GRENADE && gun != GUN_SHOTGUN) ? 2 : 1; } deathstate(pl); diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index aca14f18..aea38966 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -541,7 +541,7 @@ void raydamage(vec &from, vec &to, playerent *d) } else raysleft = true; } - if(hitrays) hitpush(hitrays*dam, o, d, from, to, d->weaponsel->type, false, hitrays); + if(hitrays) hitpush(hitrays*dam, o, d, from, to, d->weaponsel->type, hitrays == SGRAYS, hitrays); if(!raysleft) break; } }