Construction Mode: Fix Girder/Rubber mode sometimes show nil
authorWuzzy <almikes@aol.com>
Wed, 13 Apr 2016 03:17:32 +0200
changeset 11735 8cc9c8a43dcc
parent 11734 2d57eed66d41
child 11736 d07e749d925d
Construction Mode: Fix Girder/Rubber mode sometimes show nil
share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua	Wed Apr 13 03:04:24 2016 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua	Wed Apr 13 03:17:32 2016 +0200
@@ -1396,19 +1396,6 @@
 
 end
 
-function showModeMessage()
-	if CurrentHedgehog == nil then return end
-	local val = pMode[pIndex]
-	local str
-	if cat[cIndex] == "Mine Placement Mode" then
-		-- timer in seconds
-		str = string.format(loc("%d sec"), div(val, 1000))
-	else
-		str = tostring(val)
-	end
-	AddCaption(str,0xffba00ff,capgrpMessage2)
-end
-
 function onRight()
 
 	pIndex = pIndex + 1
@@ -1423,6 +1410,22 @@
 
 end
 
+function showModeMessage()
+	if CurrentHedgehog == nil then return end
+	local val = pMode[pIndex]
+	local str
+	if cat[cIndex] == "Mine Placement Mode" then
+		-- timer in seconds
+		str = string.format(loc("%d sec"), div(val, 1000))
+	elseif cat[cIndex] == "Girder Placement Mode" then
+		str = loc("Girder")
+	elseif cat[cIndex] == "Rubber Placement Mode" then
+		str = loc("Rubber")
+	else
+		str = tostring(val)
+	end
+	AddCaption(str,0xffba00ff,capgrpMessage2)
+end
 
 function updatePlacementDisplay(pDir)