hedgewars/uSound.pas
changeset 5922 7e7774e7be8c
parent 5921 43cb3139cebe
child 5932 5164d17b6374
child 6072 e3dc802965d6
equal deleted inserted replaced
5921:43cb3139cebe 5922:7e7774e7be8c
   288 end;
   288 end;
   289 
   289 
   290 procedure AddVoice(snd: TSound; voicepack: PVoicepack);
   290 procedure AddVoice(snd: TSound; voicepack: PVoicepack);
   291 var i : LongInt;
   291 var i : LongInt;
   292 begin
   292 begin
   293     if (not isSoundEnabled) or fastUntilLag or ((LastSound.snd = snd) and  (LastSound.voicepack = voicepack)) then exit;
   293     if (not isSoundEnabled) or fastUntilLag or ((LastVoice.snd = snd) and  (LastVoice.voicepack = voicepack)) then exit;
   294     i:= 0;
   294     i:= 0;
   295     while (i<8) and (VoiceList[i].snd <> sndNone) do inc(i);
   295     while (i<8) and (VoiceList[i].snd <> sndNone) do inc(i);
   296 
   296 
   297     // skip playing same sound for same hog twice
   297     // skip playing same sound for same hog twice
   298     if (i>0) and (VoiceList[i-1].snd = snd) and (VoiceList[i-1].voicepack = voicepack) then exit;
   298     if (i>0) and (VoiceList[i-1].snd = snd) and (VoiceList[i-1].voicepack = voicepack) then exit;