share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua
changeset 14526 797e3f441c14
parent 14495 ff2c1f25fc03
child 14578 50f511588635
--- a/share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua	Sun Jan 06 01:21:16 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua	Sun Jan 06 02:16:45 2019 +0100
@@ -193,12 +193,8 @@
 			-- ... end the game ...
 			generateStats()
 			EndGame()
-		else
-			-- ... or just lower the timer by 1.
-			-- Reset the time left to stop the timer
-			SetTurnTimeLeft(time_goal)
 		end
-        end_timer = end_timer - 20
+        	end_timer = end_timer - 20
 	end
 end
 
@@ -385,8 +381,7 @@
 				AddCaption(loc("Last Target!"));
 				spawnTarget(3480,1200)
 			end
-		else
-			if not game_lost then
+		elseif not game_lost then
 			-- Victory!
 			SaveMissionVar("Won", "true")
 			AddCaption(loc("Victory!"), capcolDefault, capgrpGameState)
@@ -402,7 +397,9 @@
 
 			-- Save the time left so we may keep it.
 			time_goal = TurnTimeLeft
-			end
+
+			-- Freeze the clock because the challenge has been completed
+			SetTurnTimePaused(true)
 		end
 		SetTeamLabel(playerTeamName, getTargetScore())
 	end