Racer: Show “Track completed!” message
authorWuzzy <almikes@aol.com>
Wed, 13 Apr 2016 14:01:28 +0200
changeset 11932 72593678e8d6
parent 11931 ace20b1d8d53
child 11933 42e90b244e11
Racer: Show “Track completed!” message
share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Wed Apr 13 14:00:53 2016 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Wed Apr 13 14:01:28 2016 +0200
@@ -297,7 +297,13 @@
                         end
 
                         if wpActive[i] == false then
-                                AddCaption(string.format(loc("Waypoints remaining: %d"), wpRem-1),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