Skip to content

Commit

Permalink
Revert "removed unnecessary logic"
Browse files Browse the repository at this point in the history
This reverts commit a722a5e.
  • Loading branch information
unknao committed Dec 26, 2024
1 parent 5f77e85 commit 02dc93c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lua/entities/gmod_wire_expression2/core/timer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,18 @@ e2function void timerSetDelay(string name, number delay)
end

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

timer.Adjust(luaTimerGetInternalName(entIndex, name), 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)
end

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

0 comments on commit 02dc93c

Please sign in to comment.