Fix some incorrect TechRacer messages
authorWuzzy <almikes@aol.com>
Wed, 13 Apr 2016 13:17:58 +0200
changeset 11941 c750c21e4a44
parent 11940 e1bae42efacd
child 11942 8fd4926e1e9e
Fix some incorrect TechRacer messages
share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Wed Apr 13 13:17:08 2016 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua	Wed Apr 13 13:17:58 2016 +0200
@@ -333,7 +333,13 @@
                         end
 
                         if not wpActive[i] then
-                                AddCaption(string.format(loc("Waypoints remaining: %d"), wpRem),0xffba00ff,capgrpGameState)
+                                local wpMessage = ""
+                                if wpRem-1 == 0 then
+                                        wpMessage = loc("Track completed!")
+                                else
+                                        wpMessage = string.format(loc("Waypoints remaining: %d"), wpRem-1)
+                                end
+                                AddCaption(wpMessage, 0xffba00ff, capgrpGameState)
                         end
 
                         wpActive[i] = true
@@ -1218,7 +1224,6 @@
         AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
 
         if gear == CurrentHedgehog then
-                AddCaption(loc("Race failed!"), GetClanColor(GetHogClan(gear)), capgrpMessage2)
                 DisableTumbler()
         end