share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua
changeset 11975 c52d35c859e8
parent 11692 68eddcdc9f26
child 11976 d5dabb71d6bf
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua	Sun Nov 20 15:20:08 2016 +0100
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua	Tue Nov 22 15:52:57 2016 +0100
@@ -19,6 +19,7 @@
 local battleZoneReached = false
 local checkPointReached = 1 -- 1 is start of the game
 local afterDialog02 = false
+local gameOver = false
 -- dialogs
 local dialog01 = {}
 local dialog02 = {}
@@ -353,6 +354,7 @@
 end
 
 function professorDeath(gear)
+	if gameOver then return end
 	if GetHealth(minion1.gear) then
 		AnimSay(minion1.gear, loc("The boss has fallen! Retreat!"), SAY_SHOUT, 6000)
 	elseif GetHealth(minion2.gear) then
@@ -371,10 +373,12 @@
 	SendStat(siPlayerKills,'1',teamD.name)
 	SendStat(siPlayerKills,'0',teamC.name)
 	SaveCampaignVar("CosmosCheckPoint", "5") -- hero got fuels
+	gameOver = true
 	EndGame()
 end
 
 function minionsDeath(gear)
+	if gameOver then return end
 	-- do staffs here
 	AnimSay(professor.gear, loc("I may lost this battle, but I haven't lost the war yet!"), SAY_SHOUT, 6000)
 	DismissTeam(teamC.name)
@@ -388,6 +392,7 @@
 	SendStat(siPlayerKills,'1',teamD.name)
 	SendStat(siPlayerKills,'0',teamC.name)
 	SaveCampaignVar("CosmosCheckPoint", "5") -- hero got fuels
+	gameOver = true
 	EndGame()
 end