hedgewars/uSound.pas
changeset 2832 8cb73c0e77a1
parent 2745 11fce231f24a
child 2905 f3c79f7193a9
--- a/hedgewars/uSound.pas	Sat Feb 20 18:58:51 2010 +0000
+++ b/hedgewars/uSound.pas	Sat Feb 20 19:54:24 2010 +0000
@@ -177,7 +177,11 @@
 
 function LoopSound(snd: TSound; voicepack: PVoicepack): LongInt;
 begin
-if (not isSoundEnabled) or fastUntilLag then exit;
+if (not isSoundEnabled) or fastUntilLag then
+	begin
+	LoopSound:= -1;
+	exit
+	end;
 
 if (voicepack <> nil) and (voicepack^.chunks[snd] <> nil) then
 	LoopSound:= Mix_PlayChannelTimed(-1, voicepack^.chunks[snd], -1, -1)
@@ -197,7 +201,8 @@
 
 procedure StopSound(chn: LongInt);
 begin
-	if (chn <> -1) and (Mix_Playing(chn) <> 0) then Mix_HaltChannel(chn);
+if not isSoundEnabled then exit;
+if (chn <> -1) and (Mix_Playing(chn) <> 0) then Mix_HaltChannel(chn);
 end;
 
 procedure PlayMusic;