mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-12 16:37:19 +01:00
Enforce Calculus Linter Tags (#22469)
A not insignificant number of bugs caused when converting code to calculus methods is me missing that a proc is getting called from a different file entirely without passing in a seconds_per_tick value. Byond will just gleefully let my calculus methods for code run with a time delta of 0, which introduces all manner of exotic and fascinating bugs. So to better prevent this kind of issue from occuring, I'm adding a new linter tag called ENFORCE_CALCULUS(seconds_per_tick) which loudly forces unit test fails if a proc with the tag is called by a different proc without correctly passing in the needed time delta. I have previously run into this problem on occasion, such as in PR #22413
This commit is contained in:
@@ -204,6 +204,8 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
|
||||
die()
|
||||
|
||||
/obj/item/organ/proc/tick_surge_damage(seconds_per_tick)
|
||||
ENFORCE_CALCULUS(seconds_per_tick)
|
||||
|
||||
if(!surge_damage)
|
||||
clear_surge_effects()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user