Add back the missing winning animation for Racer and TechRecer
authorWuzzy <almikes@aol.com>
Wed, 26 Apr 2017 02:10:47 +0200
changeset 12338 6bdabf67a012
parent 12337 657a8d63c99d
child 12339 0bc8c5fcd08c
Add back the missing winning animation for Racer and TechRecer
share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Wed Apr 26 01:51:51 2017 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Wed Apr 26 02:10:47 2017 +0200
@@ -434,9 +434,6 @@
 
         -- end game if its at round limit
         if roundNumber >= roundLimit then
-                gameOver = true
-                TurnTimeLeft = 10000000
-
                 -- Sort the scores for the ranking list
                 local unfinishedArray = {}
                 local sortedTeams = {}
@@ -473,8 +470,17 @@
                         SendStat(siCustomAchievement, loc("Maybe you should try easier waypoints next time."))
                 end
 
-                -- Game over
-                EndGame()
+		-- Kill all the losers
+		for i = 0, (numhhs-1) do
+			if GetHogClan(hhs[i]) ~= bestClan then
+				SetEffect(hhs[i], heResurrectable, 0)
+				SetHealth(hhs[i],0)
+			end
+		end
+
+		gameOver = true
+		EndTurn(true)
+
         end
 
 end
@@ -548,7 +554,10 @@
 
 
 function onGameStart()
+	SendGameResultOff()
+	SendRankingStatsOff()
         SendHealthStatsOff()
+	SendAchievementsStatsOff()
 
         roundN = 0
         lastRound = TotalRounds
--- a/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Wed Apr 26 01:51:51 2017 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Wed Apr 26 02:10:47 2017 +0200
@@ -460,9 +460,6 @@
 
         -- end game if its at round limit
         if roundNumber >= roundLimit then
-                gameOver = true
-                TurnTimeLeft = 10000000
-
                 -- Sort the scores for the ranking list
                 local unfinishedArray = {}
                 local sortedTeams = {}
@@ -498,8 +495,16 @@
                         SendStat(siCustomAchievement, loc("Maybe you should try an easier TechRacer map."))
                 end
 
-                -- Game over
-                EndGame()
+		-- Kill all the losers
+		for i = 0, (numhhs-1) do
+			if GetHogClan(hhs[i]) ~= bestClan then
+				SetEffect(hhs[i], heResurrectable, 0)
+				SetHealth(hhs[i],0)
+			end
+		end
+
+		gameOver = true
+		EndTurn(true)
         end
 
 end
@@ -956,6 +961,9 @@
 end
 
 function onGameStart()
+	SendGameResultOff()
+	SendRankingStatsOff()
+	SendAchievementsStatsOff()
 	SendHealthStatsOff()
 
 		trackTeams()