Skip to content

Commit c655372

Browse files
authored
Moves the stamina subsystem and stun effect processing into the ticker priority bracket (#3798)
* Moves the stamina subsystem into the ticker priority bracket * temp workaround for testmerge
1 parent 33a6e2f commit c655372

File tree

7 files changed

+22
-5
lines changed

7 files changed

+22
-5
lines changed

code/__DEFINES/status_effects.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#define STATUS_EFFECT_FAST_PROCESS 0
1313
///This is slower and better for more intensive status effects - 1s between ticks
1414
#define STATUS_EFFECT_NORMAL_PROCESS 1
15+
/// (monkestation addition) Similar speed to STATUS_EFFECT_FAST_PROCESS, but uses a high priority subsystem (SSpriority_effects).
16+
#define STATUS_EFFECT_PRIORITY 2
1517

1618
//several flags for the Necropolis curse status effect
1719
///makes the edges of the target's screen obscured

code/datums/status_effects/_status_effect.dm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@
6565
START_PROCESSING(SSfastprocess, src)
6666
if(STATUS_EFFECT_NORMAL_PROCESS)
6767
START_PROCESSING(SSprocessing, src)
68+
// monkestation start: SSpriority_effects
69+
if(STATUS_EFFECT_PRIORITY)
70+
START_PROCESSING(SSpriority_effects, src)
71+
// monkestation end
6872

6973
update_particles()
7074

@@ -76,6 +80,10 @@
7680
STOP_PROCESSING(SSfastprocess, src)
7781
if(STATUS_EFFECT_NORMAL_PROCESS)
7882
STOP_PROCESSING(SSprocessing, src)
83+
// monkestation start: SSpriority_effects
84+
if(STATUS_EFFECT_PRIORITY)
85+
STOP_PROCESSING(SSpriority_effects, src)
86+
// monkestation end
7987
if(owner)
8088
linked_alert = null
8189
owner.clear_alert(id)

code/datums/status_effects/buffs/stop_drop_roll.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/datum/status_effect/stop_drop_roll
22
id = "stop_drop_roll"
33
alert_type = null
4-
54
tick_interval = 0.8 SECONDS
5+
processing_speed = STATUS_EFFECT_PRIORITY // monkestation edit: high-priority status effect processing
66

77
/datum/status_effect/stop_drop_roll/on_apply()
88
if(!iscarbon(owner))

code/datums/status_effects/debuffs/debuffs.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
alert_type = null
77
remove_on_fullheal = TRUE
88
heal_flag_necessary = HEAL_CC_STATUS
9+
processing_speed = STATUS_EFFECT_PRIORITY // monkestation edit: high-priority status effect processing
910
var/needs_update_stat = FALSE
1011

1112
/datum/status_effect/incapacitating/on_creation(mob/living/new_owner, set_duration)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
PROCESSING_SUBSYSTEM_DEF(priority_effects)
2+
name = "Priority Status Effects"
3+
flags = SS_TICKER | SS_KEEP_TIMING | SS_NO_INIT
4+
wait = 2 // Not seconds - we're running on SS_TICKER, so this is ticks.
5+
stat_tag = "PEFF"

code/controllers/subsystem/processing/stamina.dm renamed to monkestation/code/controllers/subsystem/z_stamina.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ SUBSYSTEM_DEF(stamina)
22
name = "Stamina"
33

44
priority = FIRE_PRIORITY_STAMINA
5-
flags = SS_BACKGROUND|SS_POST_FIRE_TIMING|SS_NO_INIT
6-
wait = 1 SECONDS
5+
flags = SS_TICKER | SS_KEEP_TIMING | SS_NO_INIT
6+
wait = 10 // Not seconds - we're running on SS_TICKER, so this is ticks.
77

88
var/list/processing = list()
99
var/list/currentrun = list()
@@ -21,6 +21,6 @@ SUBSYSTEM_DEF(stamina)
2121
while(current_run.len)
2222
var/datum/stamina_container/thing = current_run[current_run.len]
2323
current_run.len--
24-
thing.update(wait * 0.1)
24+
thing.update(world.tick_lag * wait * 0.1)
2525
if (MC_TICK_CHECK)
2626
return

tgstation.dme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,6 @@
826826
#include "code\controllers\subsystem\processing\quirks.dm"
827827
#include "code\controllers\subsystem\processing\reagents.dm"
828828
#include "code\controllers\subsystem\processing\singulo.dm"
829-
#include "code\controllers\subsystem\processing\stamina.dm"
830829
#include "code\controllers\subsystem\processing\station.dm"
831830
#include "code\controllers\subsystem\processing\supermatter_cascade.dm"
832831
#include "code\controllers\subsystem\processing\tramprocess.dm"
@@ -5819,6 +5818,8 @@
58195818
#include "monkestation\code\controllers\subsystem\init_profiler.dm"
58205819
#include "monkestation\code\controllers\subsystem\job.dm"
58215820
#include "monkestation\code\controllers\subsystem\profiler.dm"
5821+
#include "monkestation\code\controllers\subsystem\z_priority_effects.dm"
5822+
#include "monkestation\code\controllers\subsystem\z_stamina.dm"
58225823
#include "monkestation\code\datums\action.dm"
58235824
#include "monkestation\code\datums\dna.dm"
58245825
#include "monkestation\code\datums\emotes.dm"

0 commit comments

Comments
 (0)