mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 02:01:22 +00:00
[MIRROR] Moves /datum/var/signal_enabled to datum flags (#3171)
* Moves /datum/var/signal_enabled to datum flags (#56372) * Moves /datum/var/signal_enabled to datum flags `signal_enabled` is a variable on /datum, so present almost every object in the game. Folding it into the existing `datum_flags` variable will save allocating a variable on every datum in the game. - Clown weaponry was using the `signal_enabled` variable to turn their attached slippery component on and off when the shield/sword was toggled. They now just remove/add the component, rather than touching deep datum internals. * Moves /datum/var/signal_enabled to datum flags Co-authored-by: coiax <yellowbounder@gmail.com>
This commit is contained in:
@@ -202,7 +202,7 @@
|
||||
else // Many other things have registered here
|
||||
lookup[sig_type][src] = TRUE
|
||||
|
||||
signal_enabled = TRUE
|
||||
datum_flags |= DF_SIGNAL_ENABLED
|
||||
|
||||
/**
|
||||
* Stop listening to a given signal from target
|
||||
@@ -311,14 +311,14 @@
|
||||
var/target = comp_lookup[sigtype]
|
||||
if(!length(target))
|
||||
var/datum/C = target
|
||||
if(!C.signal_enabled)
|
||||
if(!(C.datum_flags & DF_SIGNAL_ENABLED))
|
||||
return NONE
|
||||
var/proctype = C.signal_procs[src][sigtype]
|
||||
return NONE | CallAsync(C, proctype, arguments)
|
||||
. = NONE
|
||||
for(var/I in target)
|
||||
var/datum/C = I
|
||||
if(!C.signal_enabled)
|
||||
if(!(C.datum_flags & DF_SIGNAL_ENABLED))
|
||||
continue
|
||||
var/proctype = C.signal_procs[src][sigtype]
|
||||
. |= CallAsync(C, proctype, arguments)
|
||||
|
||||
Reference in New Issue
Block a user