hitsound when following (spectating) a player

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6457 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2011-05-22 10:54:42 +00:00
parent c98b38108a
commit cd7ad94fa4
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -815,8 +815,10 @@ void dodamage(int damage, playerent *pl, playerent *actor, int gun, bool gib, bo
if(pl->state != CS_ALIVE || intermission) return;
pl->respawnoffset = pl->lastpain = lastmillis;
// could the author of the FIXME below please elaborate what's to fix?! (ft:2011mar28)
// playerent *h = local ? player1 : updatefollowplayer(0);
if(/*actor==h && pl!=actor*/ actor == player1 && pl!=actor ) // FIXME
// I suppose someone wanted to play the hitsound for player1 or spectated player (lucas:2011may22)
playerent *h = player1->isspectating() && player1->followplayercn > 0 ? getclient(player1->followplayercn) : NULL;
if(!h) h = player1;
if(actor==h && pl!=actor)
{
if(hitsound && lasthit != lastmillis) audiomgr.playsound(S_HITSOUND, SP_HIGH);
lasthit = lastmillis;
@@ -1655,6 +1657,9 @@ void spectate(int mode)
}
break;
}
case SM_OVERVIEW:
player1->followplayercn = FPCN_OVERVIEW;
break;
default: break;
}
player1->spectatemode = mode;
+1 -1
View File
@@ -92,7 +92,7 @@ enum { ENT_PLAYER = 0, ENT_BOT, ENT_CAMERA, ENT_BOUNCE };
enum { CS_ALIVE = 0, CS_DEAD, CS_SPAWNING, CS_LAGGED, CS_EDITING, CS_SPECTATE };
enum { CR_DEFAULT = 0, CR_ADMIN };
enum { SM_NONE = 0, SM_DEATHCAM, SM_FOLLOW1ST, SM_FOLLOW3RD, SM_FOLLOW3RD_TRANSPARENT, SM_FLY, SM_OVERVIEW, SM_NUM };
enum { FPCN_VOID = -3, FPCN_DEATHCAM = -2, FPCN_FLY = -1 };
enum { FPCN_VOID = -4, FPCN_DEATHCAM = -2, FPCN_FLY = -2, FPCN_OVERVIEW = -1 };
class worldobject
{