diff --git a/code/modules/mod/mod_core.dm b/code/modules/mod/mod_core.dm index 62a214ce072..c2ce61cab7e 100644 --- a/code/modules/mod/mod_core.dm +++ b/code/modules/mod/mod_core.dm @@ -153,10 +153,12 @@ cell = new_cell cell.forceMove(src) RegisterSignal(src, COMSIG_ATOM_EXITED, PROC_REF(on_exit)) + RegisterSignal(cell, COMSIG_PARENT_QDELETING, PROC_REF(remove_cell)) /obj/item/mod/core/standard/proc/uninstall_cell() if(!cell) return + UnregisterSignal(cell, COMSIG_PARENT_QDELETING) cell = null UnregisterSignal(src, COMSIG_ATOM_EXITED) @@ -167,6 +169,11 @@ return uninstall_cell() +/obj/item/mod/core/standard/proc/remove_cell() + SIGNAL_HANDLER // COMSIG_PARENT_QDELETING + UnregisterSignal(cell, COMSIG_PARENT_QDELETING) + cell = null + /obj/item/mod/core/standard/proc/on_examine(datum/source, mob/examiner, list/examine_text) SIGNAL_HANDLER diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index e94b02f1d27..d8f6535a23b 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -128,6 +128,7 @@ message_admins("LOG: Rigged power cell explosion, last touched by [fingerprintslast]") explosion(T, devastation_range, heavy_impact_range, light_impact_range, flash_range) + charge = 0 //Extra safety in the event the cell does not QDEL right qdel(src) /obj/item/stock_parts/cell/proc/corrupt()