# HG changeset patch # User Wuzzy # Date 1461686088 -7200 # Node ID 001994046892b5e9d33358e9afe6edf7b415883c # Parent 1e2ec1be5041d2f489ce2618728e4bba280b5c1a Construction Mode: Don't update ticker for cursor keys when hedgehog is not under control anymore diff -r 1e2ec1be5041 -r 001994046892 share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua Tue Apr 26 17:40:29 2016 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua Tue Apr 26 17:54:48 2016 +0200 @@ -1262,7 +1262,8 @@ end -- update display selection criteria - if (curWep == amGirder) or (curWep == amAirAttack) or (curWep == amNapalm) or (curWep == amDrillStrike) or (curWep == amRubber) then + if ((curWep == amGirder) or (curWep == amAirAttack) or (curWep == amNapalm) or (curWep == amDrillStrike) or (curWep == amRubber)) + and (CurrentHedgehog ~= nil or band(GetState(CurrentHedgehog), gstHHDriven) ~= 0) then ---------------hooolllllyyyy fucking shit this -- code is a broken mess now @@ -1346,6 +1347,8 @@ function updateCost() + if CurrentHedgehog == nil or band(GetState(CurrentHedgehog), gstHHDriven) == 0 then return end + if pMode[pIndex] == loc("Healing Station") then placedExpense = 50 elseif pMode[pIndex] == loc("Weapon Filter") then @@ -1410,7 +1413,7 @@ end function showModeMessage() - if CurrentHedgehog == nil then return end + if CurrentHedgehog == nil or band(GetState(CurrentHedgehog), gstHHDriven) == 0 then return end local val = pMode[pIndex] local str if cat[cIndex] == "Mine Placement Mode" then @@ -1478,7 +1481,9 @@ function onUp() if ( (curWep == amNapalm) or (curWep == amDrillStrike) ) then - updatePlacementDisplay(-1) + if CurrentHedgehog ~= nil or band(GetState(CurrentHedgehog), gstHHDriven) ~= 0 then + updatePlacementDisplay(-1) + end end end @@ -1486,7 +1491,9 @@ function onDown() if ( (curWep == amNapalm) or (curWep == amDrillStrike) ) then - updatePlacementDisplay(1) + if CurrentHedgehog ~= nil or band(GetState(CurrentHedgehog), gstHHDriven) ~= 0 then + updatePlacementDisplay(1) + end end end