From e8d1c2df1c01e46a9984aefcf28e993866da9097 Mon Sep 17 00:00:00 2001 From: driAn Date: Mon, 10 Nov 2008 13:31:20 +0000 Subject: [PATCH] play crouch/uncrouch sound once git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3485 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/physics.cpp | 10 +++++++--- source/src/sound.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/source/src/physics.cpp b/source/src/physics.cpp index 543258ee..09e974df 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -595,9 +595,12 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime) else if(pl->inwater && !water) playsound(S_SPLASH1, &pl->o); pl->inwater = water; } - // Added by Rick: Easy hack to store previous locations of all players/monsters/bots - if(pl->type==ENT_PLAYER || pl->type==ENT_BOT) ((playerent *)pl)->history.update(pl->o, lastmillis); - // End add + + // store previous locations of all players/bots + if(pl->type==ENT_PLAYER || pl->type==ENT_BOT) + { + ((playerent *)pl)->history.update(pl->o, lastmillis); + } // apply volume-resize when crouching if(pl->type==ENT_PLAYER) @@ -713,6 +716,7 @@ void crouch(bool on) { if(player1->isspectating()) return; player1->trycrouch = on; + playsoundc(player1->crouching ? S_CROUCH : S_UNCROUCH); } COMMAND(backward, ARG_DOWN); diff --git a/source/src/sound.h b/source/src/sound.h index dc6d716d..d8a03cc5 100644 --- a/source/src/sound.h +++ b/source/src/sound.h @@ -23,6 +23,7 @@ enum S_GIB, S_HEADSHOT, S_CALLVOTE, S_VOTEPASS, S_VOTEFAIL, S_FOOTSTEPS, S_FOOTSTEPSCROUCH, S_WATERFOOTSTEPS, S_WATERFOOTSTEPSCROUCH, + S_CROUCH, S_UNCROUCH, S_MENUSELECT, S_MENUENTER, S_UNDERWATER, S_TINNITUS,