# HG changeset patch # User Wuzzy # Date 1460510252 -7200 # Node ID 8cc9c8a43dcc8878f7792a8cb0ca60180f0c16b7 # Parent 2d57eed66d419ce26a16d0c2a70bfc041dd59d3b Construction Mode: Fix Girder/Rubber mode sometimes show nil diff -r 2d57eed66d41 -r 8cc9c8a43dcc 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)