- Fix quickplay sound bug triggered by two faults: ttsmj's (passing voicepack with empty name in team config) and koda's (he changed fallback to default scheme condition)
authorunc0rr
Wed, 24 Jun 2009 19:47:32 +0000
changeset 2192 4763a778c033
parent 2191 20c62f787a4d
child 2193 4d5d78aa7ca4
- Fix quickplay sound bug triggered by two faults: ttsmj's (passing voicepack with empty name in team config) and koda's (he changed fallback to default scheme condition) - Fix openal's warning (trying to fadeout not loaded music)
QTfrontend/SDLs.cpp
QTfrontend/namegen.cpp
QTfrontend/team.cpp
hedgewars/uSound.pas
--- a/QTfrontend/SDLs.cpp	Wed Jun 24 15:59:32 2009 +0000
+++ b/QTfrontend/SDLs.cpp	Wed Jun 24 19:47:32 2009 +0000
@@ -69,5 +69,5 @@
 
 void SDLInteraction::StopMusic()
 {
-	openal_fadeout(music, 50);
+	if (music >= 0) openal_fadeout(music, 50);
 }
--- a/QTfrontend/namegen.cpp	Wed Jun 24 15:59:32 2009 +0000
+++ b/QTfrontend/namegen.cpp	Wed Jun 24 19:47:32 2009 +0000
@@ -56,6 +56,7 @@
 			}
 			team->Grave = "Simple"; // Todo: make it semi-random
 			team->Fort = "Island"; // Todo: make it semi-random
+			team->Voicepack = "Default";
 		}
 
 		for(int i = 0; i < 8; i++)
--- a/QTfrontend/team.cpp	Wed Jun 24 15:59:32 2009 +0000
+++ b/QTfrontend/team.cpp	Wed Jun 24 19:47:32 2009 +0000
@@ -82,6 +82,7 @@
 
 	Grave = QString("Simple"); // default
 	Fort = QString("Island"); // default
+	Voicepack = "Default";
 
 	for(int i = 0; i < BINDS_NUMBER; i++)
 	{
--- a/hedgewars/uSound.pas	Wed Jun 24 15:59:32 2009 +0000
+++ b/hedgewars/uSound.pas	Wed Jun 24 19:47:32 2009 +0000
@@ -89,6 +89,7 @@
 	end;
 
 voicepacks[i].name:= name;
+addfilelog('================================================ '+inttostr(i));
 AskForVoicepack:= @voicepacks[i]
 end;
 
@@ -157,7 +158,6 @@
 	if infinite then openal_toggleloop(defVoicepack^.chunks[snd]);
 	openal_playsound(defVoicepack^.chunks[snd]);
 	lastChan[snd]:=defVoicepack^.chunks[snd];
-
 end
 end;
 
@@ -203,4 +203,14 @@
 openal_playsound(Mus);
 end;
 
+
+var i: LongInt;
+	c: TSound;
+
+initialization
+for i:= 0 to cMaxTeams do
+	for c:= Low(TSound) to High(TSound) do
+		voicepacks[i].chunks[c]:= -1
+
+
 end.