fixed bug that make hog not able to move spacecampaign
authorPeriklis Ntanasis <pntanasis@gmail.com>
Sat, 10 Aug 2013 00:00:41 +0300
branchspacecampaign
changeset 9498 54bfc44f9554
parent 9496 ffab82d05785
child 9500 c9487f415fd3
fixed bug that make hog not able to move
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua	Fri Aug 09 23:30:33 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua	Sat Aug 10 00:00:41 2013 +0300
@@ -14,6 +14,7 @@
 local campaignName = loc("A Space Adventure")
 local missionName = loc("Fruit planet, The War!")
 local chooseToBattle = false
+local previousHog = 0
 -- dialogs
 local dialog01 = {}
 local dialog02 = {}
@@ -174,15 +175,11 @@
 
 function onNewTurn()
 	if CurrentHedgehog == green1.gear then
-		TotalRounds = TotalRounds - 1
-		if GetHealth(green2.gear) then
-			SwitchHog(green2.gear)
-		elseif GetHealth(green3.gear) then
-			SwitchHog(green3.gear)
-		elseif GetHealth(green4.gear) then
-			SwitchHog(green4.gear)
-		end
+		TotalRounds = TotalRounds - 2
+		SwitchHog(previousHog)
+		TurnTimeLeft = 0
 	end
+	previousHog = CurrentHedghog
 	getNextWave()
 end