fixed splash sound flood, refactored audio
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2183 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -476,7 +476,11 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
|
||||
// play sounds on water transitions
|
||||
if(!pl->inwater && water)
|
||||
{
|
||||
playsound(S_SPLASH2, NULL, NULL, &pl->o);
|
||||
if(!pl->lastsplash || lastmillis-pl->lastsplash>500)
|
||||
{
|
||||
playsound(S_SPLASH2, NULL, NULL, pl==player1 ? NULL : &pl->o);
|
||||
pl->lastsplash = lastmillis;
|
||||
}
|
||||
if(pl==player1) pl->vel.z = 0;
|
||||
}
|
||||
else if(pl->inwater && !water) playsound(S_SPLASH1, NULL, NULL, &pl->o);
|
||||
|
||||
Reference in New Issue
Block a user