Skip to content

Commit

Permalink
cmd limiter: exclude for spectator
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruwetuin committed Nov 22, 2024
1 parent 63ccfdb commit eb9bbeb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion luarules/gadgets/cmd_limiter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ local history = {}
local totalCmdCount = 0
local totalOffence = 0
local offenceFrames = {}

local spec = Spring.GetSpectatingState()
function gadget:PlayerChanged(playerID)
spec = Spring.GetSpectatingState()
end

function gadget:CommandNotify(cmdID, cmdParams, cmdOpts)
if cmdID < 0 then -- is build order
if cmdID < 0 and not spec then -- is build order
if cmdOpts.shift then
local gf = Spring.GetGameFrame()
if offenceFrames[gf] then
Expand Down

0 comments on commit eb9bbeb

Please sign in to comment.