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:
driAn
2008-07-18 19:20:09 +00:00
parent f2e4e46080
commit b817fbc353
5 changed files with 775 additions and 412 deletions
+5 -1
View File
@@ -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);