Fix false victory in Teamwork/Teamwork 2 when one of your hogs die in same turn as enemy
authorWuzzy <almikes@aol.com>
Thu, 27 Apr 2017 03:11:50 +0200
changeset 12357 7f09d01ecb45
parent 12356 62b935bec899
child 12358 ebff18a44c1e
Fix false victory in Teamwork/Teamwork 2 when one of your hogs die in same turn as enemy
share/hedgewars/Data/Missions/Scenario/User_Mission_-_Teamwork.lua
share/hedgewars/Data/Missions/Scenario/User_Mission_-_Teamwork_2.lua
--- a/share/hedgewars/Data/Missions/Scenario/User_Mission_-_Teamwork.lua	Thu Apr 27 02:42:40 2017 +0200
+++ b/share/hedgewars/Data/Missions/Scenario/User_Mission_-_Teamwork.lua	Thu Apr 27 03:11:50 2017 +0200
@@ -107,11 +107,8 @@
 	if GetGearType(gear) == gtCase then
 		TurnTimeLeft = TurnTimeLeft + 5000
 	end
-
-	if (gear == enemy) and (GameOver == false) then
-		ShowMission(loc("Teamwork"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0)
-		GameOver = true
-	elseif  ( ((gear == player) or (gear == p2)) and (GameOver == false)) then
+	-- Note: The victory sequence is done automatically by Hedgewars
+	if  ( ((gear == player) or (gear == p2)) and (GameOver == false)) then
 		ShowMission(loc("Teamwork"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
 		GameOver = true
 		SetHealth(p2,0)
--- a/share/hedgewars/Data/Missions/Scenario/User_Mission_-_Teamwork_2.lua	Thu Apr 27 02:42:40 2017 +0200
+++ b/share/hedgewars/Data/Missions/Scenario/User_Mission_-_Teamwork_2.lua	Thu Apr 27 03:11:50 2017 +0200
@@ -107,10 +107,8 @@
 	if gear == Pack then
 		HogSay(CurrentHedgehog, loc("This will certianly come in handy."), SAY_THINK)
 	end
-	if (gear == enemy) and (GameOver == false) then
-		ShowMission(loc("Teamwork 2"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0)
-		GameOver = true
-	elseif ( ((gear == player) or (gear == hlayer)) and (GameOver == false)) then
+	-- Note: The victory sequence is done automatically by Hedgewars
+	if ( ((gear == player) or (gear == hlayer)) and (GameOver == false)) then
 		ShowMission(loc("Teamwork 2"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
 		GameOver = true
 		SetHealth(hlayer, 0)