Skip to content

Commit

Permalink
fixed possible crash possibly caused by ghost timer
Browse files Browse the repository at this point in the history
  • Loading branch information
Pshy0 committed Aug 21, 2023
1 parent 35a830b commit a6be55a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/pshy/bases/loopmore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
--
-- @author TFM:Pshy#3752 DC:Pshy#7998
pshy.require("pshy.events")
pshy.require("pshy.utils.print")



Expand Down Expand Up @@ -51,7 +52,10 @@ end
local function TimerCallback(tfmid, id)
local timer = timers[id]
--print("timer #" .. tostring(id) .. "/" .. tostring(#timers) .. ": " .. tostring(os.time() % 10000))
assert(timer ~= nil, "timer #" .. tostring(id) .. "/" .. tostring(#timers) .. ": " .. tostring(os.time() % 10000))
if timer == nil then
print_error("timer was nil: #" .. tostring(id) .. "/" .. tostring(#timers) .. ": " .. tostring(os.time() % 10000))
return
end
--timer.sync_time = os.time() % tfm_timers_interval
RunLoopMore()
end
Expand Down

0 comments on commit a6be55a

Please sign in to comment.