Deletes misleading infinite define, adds defines for clearer status effect durations (#87842)

## About The Pull Request

1. Deletes `INFINTIE`, it is misleading and not at all a big number and
causes bugs
2. Adds `STATUS_EFFECT_PERMANENT` and `STATUS_EFFECT_NO_TICK` to make it
clearer what infinite status effects are
This commit is contained in:
MrMelbert
2024-11-12 17:24:27 +01:00
committed by GitHub
parent 155c343684
commit 239797a4ee
43 changed files with 134 additions and 117 deletions
+10 -10
View File
@@ -3,21 +3,21 @@
/datum/unit_test/status_effect_ticks/Run()
for(var/datum/status_effect/checking as anything in subtypesof(/datum/status_effect))
var/checking_tick = initial(checking.tick_interval)
if(checking_tick == -1)
var/tick_speed = initial(checking.tick_interval)
if(tick_speed == STATUS_EFFECT_NO_TICK)
continue
if(checking_tick == INFINITY)
TEST_FAIL("Status effect [checking] has tick_interval set to INFINITY, this is not how you prevent ticks - use tick_interval = -1 instead.")
if(tick_speed == INFINITY)
TEST_FAIL("Status effect [checking] has tick_interval set to INFINITY, this is not how you prevent ticks - use tick_interval = STATUS_EFFECT_NO_TICK instead.")
continue
if(checking_tick == 0)
TEST_FAIL("Status effect [checking] has tick_interval set to 0, this is not how you prevent ticks - use tick_interval = -1 instead.")
if(tick_speed == 0)
TEST_FAIL("Status effect [checking] has tick_interval set to 0, this is not how you prevent ticks - use tick_interval = STATUS_EFFECT_NO_TICK instead.")
continue
switch(initial(checking.processing_speed))
if(STATUS_EFFECT_FAST_PROCESS)
if(checking_tick < SSfastprocess.wait)
TEST_FAIL("Status effect [checking] has tick_interval set to [checking_tick], which is faster than SSfastprocess can tick ([SSfastprocess.wait]).")
if(tick_speed < SSfastprocess.wait)
TEST_FAIL("Status effect [checking] has tick_interval set to [tick_speed], which is faster than SSfastprocess can tick ([SSfastprocess.wait]).")
if(STATUS_EFFECT_NORMAL_PROCESS)
if(checking_tick < SSprocessing.wait)
TEST_FAIL("Status effect [checking] has tick_interval set to [checking_tick], which is faster than SSprocessing can tick ([SSprocessing.wait]).")
if(tick_speed < SSprocessing.wait)
TEST_FAIL("Status effect [checking] has tick_interval set to [tick_speed], which is faster than SSprocessing can tick ([SSprocessing.wait]).")
else
TEST_FAIL("Invalid processing speed for status effect [checking] : [initial(checking.processing_speed)]")