mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
Runechat no longer breaks if the tick lag changes (#53570)
Resets the runechat bucket when the tick lag changes
This commit is contained in:
@@ -50,6 +50,7 @@ SUBSYSTEM_DEF(runechat)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
|
||||
// Check for when we need to loop the buckets, this occurs when
|
||||
// the head_offset is approaching BUCKET_LEN ticks in the past
|
||||
if (practical_offset > BUCKET_LEN)
|
||||
@@ -57,6 +58,11 @@ SUBSYSTEM_DEF(runechat)
|
||||
practical_offset = 1
|
||||
resumed = FALSE
|
||||
|
||||
// Check for when we have to reset buckets, typically from auto-reset
|
||||
if ((length(bucket_list) != BUCKET_LEN) || (world.tick_lag != bucket_resolution))
|
||||
reset_buckets()
|
||||
bucket_list = src.bucket_list
|
||||
resumed = FALSE
|
||||
// Store a reference to the 'working' chatmessage so that we can resume if the MC
|
||||
// has us stop mid-way through processing
|
||||
var/static/datum/chatmessage/cm
|
||||
@@ -119,6 +125,11 @@ SUBSYSTEM_DEF(runechat)
|
||||
bucket_list |= SSrunechat.bucket_list
|
||||
second_queue |= SSrunechat.second_queue
|
||||
|
||||
/datum/controller/subsystem/runechat/proc/reset_buckets()
|
||||
bucket_list.len = BUCKET_LEN
|
||||
head_offset = world.time
|
||||
bucket_resolution = world.tick_lag
|
||||
|
||||
/**
|
||||
* Enters the runechat subsystem with this chatmessage, inserting it into the end-of-life queue
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user