# HG changeset patch # User nemo # Date 1316127256 14400 # Node ID 43cb3139cebe15eb05266776c15d932b3d21a875 # Parent 32c0c0d37b6a9f48502c916d29e64839b051d406 Avoid hog repeating himself diff -r 32c0c0d37b6a -r 43cb3139cebe hedgewars/uSound.pas --- a/hedgewars/uSound.pas Fri Sep 16 00:32:53 2011 +0200 +++ b/hedgewars/uSound.pas Thu Sep 15 18:54:16 2011 -0400 @@ -290,10 +290,12 @@ procedure AddVoice(snd: TSound; voicepack: PVoicepack); var i : LongInt; begin - if (not isSoundEnabled) or fastUntilLag then exit; + if (not isSoundEnabled) or fastUntilLag or ((LastSound.snd = snd) and (LastSound.voicepack = voicepack)) then exit; i:= 0; while (i<8) and (VoiceList[i].snd <> sndNone) do inc(i); + // skip playing same sound for same hog twice + if (i>0) and (VoiceList[i-1].snd = snd) and (VoiceList[i-1].voicepack = voicepack) then exit; VoiceList[i].snd:= snd; VoiceList[i].voicepack:= voicepack; end;