Fixes decals causing 20k runtimes and blood not cleaning (#53967)

decals will unregister signals and wont try to clean twice
This commit is contained in:
TiviPlus
2020-09-29 11:29:42 +02:00
committed by GitHub
parent 216714ae1b
commit 4252d828e6
4 changed files with 6 additions and 8 deletions
-2
View File
@@ -672,8 +672,6 @@
///Returned by cleanable components when they are cleaned.
#define COMPONENT_CLEANED (1<<0)
///from base of datum/component/forensics/wipe_blood_dna(): ()
#define COMSIG_WIPE_BLOOD_DNA "wipe_blood_dna"
//Creamed
-1
View File
@@ -43,7 +43,6 @@
/datum/component/forensics/proc/wipe_blood_DNA()
blood_DNA = null
SEND_SIGNAL(src, COMSIG_WIPE_BLOOD_DNA)
return TRUE
/datum/component/forensics/proc/wipe_fibers()
+1 -2
View File
@@ -36,8 +36,7 @@
return TRUE
/datum/element/decal/Detach(atom/source, force)
UnregisterSignal(source, list(COMSIG_ATOM_DIR_CHANGE, COMSIG_COMPONENT_CLEAN_ACT, COMSIG_PARENT_EXAMINE))
UnregisterSignal(source,COMSIG_ATOM_UPDATE_OVERLAYS)
UnregisterSignal(source, list(COMSIG_ATOM_DIR_CHANGE, COMSIG_COMPONENT_CLEAN_ACT, COMSIG_PARENT_EXAMINE, COMSIG_ATOM_UPDATE_OVERLAYS))
source.update_icon()
if(isitem(source))
INVOKE_ASYNC(source, /obj/item/.proc/update_slot_icon)
+5 -3
View File
@@ -1,5 +1,4 @@
/datum/element/decal/blood
//dupe_mode = COMPONENT_DUPE_UNIQUE
/datum/element/decal/blood/Attach(datum/target, _icon, _icon_state, _dir, _cleanable=CLEAN_TYPE_BLOOD, _color, _layer=ABOVE_OBJ_LAYER)
if(!isitem(target))
@@ -7,8 +6,11 @@
. = ..()
RegisterSignal(target, COMSIG_ATOM_GET_EXAMINE_NAME, .proc/get_examine_name)
RegisterSignal(target, COMSIG_WIPE_BLOOD_DNA, .proc/Detach)
RegisterSignal(target, COMSIG_ATOM_GET_EXAMINE_NAME, .proc/get_examine_name, TRUE)
/datum/element/decal/blood/Detach(atom/source, force)
UnregisterSignal(source, COMSIG_ATOM_GET_EXAMINE_NAME)
return ..()
/datum/element/decal/blood/generate_appearance(_icon, _icon_state, _dir, _layer, _color, _alpha, source)
var/obj/item/I = source