Skip to content

Commit

Permalink
setReinforceTimer no longer clears all timers, closes #112
Browse files Browse the repository at this point in the history
  • Loading branch information
birgersp committed Mar 4, 2019
1 parent b7f76e0 commit 5b81517
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autogft/setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,14 @@ end
-- @param #number timeInterval Time [seconds] between each reinforcement
-- @return #Setup This instance (self)
function autogft_Setup:setReinforceTimer(timeInterval)
self:stopReinforcing()

assert(#self.taskForce.reinforcer.baseZones > 0, "Cannot set reinforcing timer for this task force, no base zones are declared.")

if self.reinforcementTimerId then
timer.removeFunction(self.reinforcementTimerId)
self.reinforcementTimerId = nil
end

local function reinforce()
self:checkBaseLinks()
if #self.taskForce.reinforcer.baseZones > 0 then
Expand Down

0 comments on commit 5b81517

Please sign in to comment.