mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Fix: potential bucket corruption in timer reset_buckets (#17231)
Co-authored-by: Simon Ogorodnik <simon.ogorodnik@gmail.com>
This commit is contained in:
co-authored by
Simon Ogorodnik
parent
d81602416e
commit
b593bc2c92
@@ -265,6 +265,12 @@ SUBSYSTEM_DEF(timer)
|
||||
// Add all timed events from the secondary queue as well
|
||||
alltimers += second_queue
|
||||
|
||||
for (var/datum/timedevent/t in alltimers)
|
||||
t.bucket_joined = FALSE
|
||||
t.bucket_pos = -1
|
||||
t.prev = null
|
||||
t.next = null
|
||||
|
||||
// If there are no timers being tracked by the subsystem,
|
||||
// there is no need to do any further rebuilding
|
||||
if (!length(alltimers))
|
||||
@@ -308,6 +314,7 @@ SUBSYSTEM_DEF(timer)
|
||||
new_bucket_count++
|
||||
var/bucket_pos = BUCKET_POS(timer)
|
||||
timer.bucket_pos = bucket_pos
|
||||
timer.bucket_joined = TRUE
|
||||
|
||||
var/datum/timedevent/bucket_head = bucket_list[bucket_pos]
|
||||
if (!bucket_head)
|
||||
|
||||
Reference in New Issue
Block a user