Skip to content

Commit

Permalink
Revert "Fix design oversight on timerSetDelay."
Browse files Browse the repository at this point in the history
This reverts commit e9fe870.
  • Loading branch information
unknao committed Dec 26, 2024
1 parent 02dc93c commit 5f6bde8
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions lua/entities/gmod_wire_expression2/core/timer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ local luaTimers = {
delay = 1,
repetitions = 1
}
}
}
*/
}

Expand Down Expand Up @@ -244,18 +244,8 @@ e2function void timerSetDelay(string name, number delay)
end

local entIndex = self.entity:EntIndex()
local internalName = luaTimerGetInternalName(entIndex, name)
luaTimers[entIndex][name].delay = delay

if luaTimers[entIndex][name].repetitions > 0 then
local repsLeft = timer.RepsLeft(internalName)
if repsLeft == 0 then return end

luaTimers[entIndex][name].repetitions = repsLeft
timer.Adjust(internalName, delay, repsLeft)
return
end
timer.Adjust(internalName, delay, 0)
timer.Adjust(luaTimerGetInternalName(entIndex, name), delay, 0)
end

e2function number timerSetReps(string name, number repetitions)
Expand Down

0 comments on commit 5f6bde8

Please sign in to comment.