ASA moon01: Fix broken victory condition when eliminating minions
authorWuzzy <Wuzzy2@mail.ru>
Fri, 01 Nov 2019 12:42:31 +0100
changeset 15521 e3bf91fbd3f8
parent 15520 7f9d8f574ac9
child 15522 5eda4d7056bc
ASA moon01: Fix broken victory condition when eliminating minions
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua	Fri Nov 01 11:42:53 2019 +0100
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua	Fri Nov 01 12:42:31 2019 +0100
@@ -20,6 +20,7 @@
 local checkPointReached = 1 -- 1 is start of the game
 local afterDialog02 = false
 local gameOver = false
+local minionsDead = false
 -- dialogs
 local dialog01 = {}
 local dialog02 = {}
@@ -262,6 +263,9 @@
 			EndTurn(true)
 		end
 	end
+	if minionsDead and (not (professor.dead or GetHealth(professor.gear) == nil or GetHealth(professor.gear) == 0)) then
+		FollowGear(professor.gear)
+	end
 end
 
 function onPrecise()
@@ -444,9 +448,11 @@
 end
 
 function minionsDeath(gear)
+	minionsDead = true
 	if professor.dead or GetHealth(professor.gear) == nil or GetHealth(professor.gear) == 0 then return end
 	if gameOver then return end
 	if (not IsHogAlive(hero.gear)) or (not StoppedGear(hero.gear)) then return end
+	SetTeamPassive(teamC.name, false)
 	AddAnim(dialog05)
 end