mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
Fixes timer buckets going into negatives and adds a regression test
This commit is contained in:
@@ -212,6 +212,7 @@ SUBSYSTEM_DEF(timer)
|
||||
if(!(qtimer.flags & TIMER_LOOP))
|
||||
qdel(qtimer)
|
||||
else
|
||||
bucket_count++
|
||||
qtimer.spent = 0
|
||||
qtimer.bucketEject()
|
||||
if(qtimer.flags & TIMER_CLIENT_TIME)
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
//include unit test files in this module in this ifdef
|
||||
//Keep this sorted alphabetically
|
||||
|
||||
#ifdef UNIT_TESTS
|
||||
#include "unit_test.dm"
|
||||
#include "reagent_recipe_collisions.dm"
|
||||
#include "reagent_id_typos.dm"
|
||||
#include "reagent_recipe_collisions.dm"
|
||||
#include "spawn_humans.dm"
|
||||
#include "subsystem_init.dm"
|
||||
#include "timer_sanity.dm"
|
||||
#include "unit_test.dm"
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
/datum/unit_test/timer_sanity/Run()
|
||||
if(SStimer.bucket_count < 0)
|
||||
Fail("SStimer is going into negative bucket count from something")
|
||||
Reference in New Issue
Block a user