diff --git a/code/__defines/MC.dm b/code/__defines/MC.dm index 375deb2fd5e..ddc5a1c7516 100644 --- a/code/__defines/MC.dm +++ b/code/__defines/MC.dm @@ -99,7 +99,9 @@ if(Datum.is_processing) {\ // TIMER_OVERRIDE is impossible to support because we don't track that for DPC queued calls, and adding a third list for that would be a lot of overhead for no real benefit // TIMER_STOPPABLE can't work because it uses timer IDs instead of hashes, and DPC queued calls don't have IDs. // TIMER_LOOP doesn't work because it needs to be a timer that can re-insert in the list, and a zero-wait looping timer should really be a ticker subsystem instead. -// Update this define if any of those change. +// Update these defines if any of those change. +/// These are the flags forbidden when putting zero-wait timers on SSdpc instead of SStimer. +#define DPC_FORBID_FLAGS TIMER_UNIQUE | TIMER_OVERRIDE | TIMER_STOPPABLE | TIMER_LOOP /// These are the flags forbidden when putting zero-wait TIMER_UNIQUE timers on SSdpc instead of SStimer. #define UDPC_FORBID_FLAGS TIMER_OVERRIDE | TIMER_STOPPABLE | TIMER_LOOP diff --git a/code/controllers/subsystems/DPC.dm b/code/controllers/subsystems/DPC.dm index 58a58d00b04..1adde54dfb1 100644 --- a/code/controllers/subsystems/DPC.dm +++ b/code/controllers/subsystems/DPC.dm @@ -1,7 +1,7 @@ /* This is pretty much just an optimization for wait=0 timers. They're relatively common, but generally don't actually need the more complex features of SStimer. SSdpc can handle these timers instead (and it's a lot simpler than SStimer is), but it can't handle - complex timers with flags. This doesn't need to be explicitly used, eligible timers are automatically converted. + timers with certain flags (check MC.dm). This doesn't need to be explicitly used, eligible timers are automatically converted. */ SUBSYSTEM_DEF(dpc) @@ -17,7 +17,7 @@ SUBSYSTEM_DEF(dpc) var/unique_avg = 0 /datum/controller/subsystem/dpc/stat_entry() - return ..() + " Q: [queued_calls.len], AQ: ~[round(avg)], UQ: [unique_queued_calls.len], AQ: ~[round(unique_avg)]" + return ..() + " Q: [queued_calls.len], AQ: ~[round(avg)], UQ: [unique_queued_calls.len], UAQ: ~[round(unique_avg)]" /datum/controller/subsystem/dpc/fire(resumed = FALSE) var/list/qc = queued_calls diff --git a/code/controllers/subsystems/timer.dm b/code/controllers/subsystems/timer.dm index a4c435cf204..10195799ea2 100644 --- a/code/controllers/subsystems/timer.dm +++ b/code/controllers/subsystems/timer.dm @@ -569,7 +569,7 @@ SUBSYSTEM_DEF(timer) PRINT_STACK_TRACE("addtimer called with a callback assigned to a qdeleted object. In the future such timers will not \ be supported and may refuse to run or run with a 0 wait") - if (wait == 0 && !flags) + if (wait == 0 && !(flags & DPC_FORBID_FLAGS)) SSdpc.queued_calls += callback return