Files
Bubberstation/code/datums/elements/update_icon_blocker.dm
SkyratBot 6f8b19cfa6 [MIRROR] Buffs Heretic Curses, Living Heart, Leeching Walk, and technically Entropic Plume by fixing some bugs [MDB IGNORE] (#15986)
* Buffs Heretic Curses, Living Heart, Leeching Walk, and technically Entropic Plume by fixing some bugs

* resolve conflicts

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
2022-09-04 19:28:17 +01:00

19 lines
599 B
Plaintext

/// Prevents calling anything in update_icon() like update_icon_state() or update_overlays()
/datum/element/update_icon_blocker
/datum/element/update_icon_blocker/Attach(datum/target)
. = ..()
if(!isatom(target))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_ATOM_UPDATE_ICON, .proc/block_update_icon)
/datum/element/update_icon_blocker/Detach(datum/source, ...)
UnregisterSignal(source, COMSIG_ATOM_UPDATE_ICON)
return ..()
/datum/element/update_icon_blocker/proc/block_update_icon()
SIGNAL_HANDLER
return COMSIG_ATOM_NO_UPDATE_ICON_STATE | COMSIG_ATOM_NO_UPDATE_OVERLAYS