share/hedgewars/Data/Maps/TrophyRace/map.lua
branch0.9.19
changeset 9142 0dceffbaa4ee
parent 9138 9e94a9bc8c7e
child 9657 2d8cae3c0855
--- a/share/hedgewars/Data/Maps/TrophyRace/map.lua	Sat Aug 24 01:22:45 2013 +0400
+++ b/share/hedgewars/Data/Maps/TrophyRace/map.lua	Sat Aug 24 01:37:20 2013 +0400
@@ -31,6 +31,7 @@
 
 -- hog with best time
 local besthog = nil
+local besthogteam = ""
 
 -- hog with worst time (per round)
 local worsthog = nil
@@ -112,6 +113,7 @@
 			if ttime < besttime then
 				besttime = ttime
 				besthog = CurrentHedgehog
+                besthogteam = GetHogTeamName(besthog)
 				hscore = hscore .. loc("NEW fastest lap: ")
 			else
 				hscore = hscore .. loc("Fastest lap: ")
@@ -165,6 +167,6 @@
 
 function onAchievementsDeclaration()
     if besthog ~= nil then
-      DeclareAchievement("rope race", GetHogTeamName(besthog), "TrophyRace", besttime)
+      DeclareAchievement("rope race", besthogteam, "TrophyRace", besttime)
     end
 end