share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua
changeset 14617 bd15c8551318
parent 14583 50f511588635
child 14903 4596357d002d
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua	Wed Jan 16 15:40:11 2019 +0100
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua	Wed Jan 16 19:59:08 2019 +0100
@@ -12,6 +12,7 @@
 -- globals
 local missionName = loc("Hard flying")
 local challengeStarted = false
+local challengeStartRequested = false
 local currentWaypoint = 1
 local radius = 75 -- Ring radius. Will become smaller and smaller
 local totalTime = 15000 -- Total available time. Initial value is start time; is added to later when player wins extra time
@@ -88,6 +89,7 @@
 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
 	-- Ally
 	teamB.name = AddTeam(teamB.name, teamB.color, "heart", "Island", "Default", "cm_face")
+	SetTeamPassive(teamB.name, true)
 	ally.gear = AddHog(ally.name, 0, 100, "war_airwarden02")
 	AnimSetGearPosition(ally.gear, ally.x, ally.y)
 	HogTurnLeft(ally.gear, true)
@@ -134,9 +136,10 @@
 end
 
 function onNewTurn()
-	if not hero.dead and CurrentHedgehog == ally.gear and challengeStarted then
-		heroLost()
-	elseif not hero.dead and CurrentHedgehog == hero.gear and challengeStarted then
+	if challengeStartRequested then
+		challengeStarted = true
+	end
+	if not hero.dead and CurrentHedgehog == hero.gear and challengeStarted then
 		SetWeapon(amJetpack)
 	end
 	heroTurn = CurrentHedgehog == hero.gear
@@ -258,9 +261,8 @@
 ------------------ Other Functions -------------------
 
 function startFlying()
-	AnimSwitchHog(ally.gear)
+	challengeStartRequested = true
 	EndTurn(true)
-	challengeStarted = true
 end
 
 function placeNextWaypoint()