Merge pull request #9704 from atlantiscze/clean-up-your-trash

[Done] Implements Destroy()'s on some things
This commit is contained in:
Zuhayr
2015-06-10 23:07:38 +09:30
7 changed files with 64 additions and 3 deletions

View File

@@ -24,6 +24,27 @@ var/list/organ_cache = list()
// links chemical IDs to number of ticks for which they'll stay in the blood
germ_level = 0
/obj/item/organ/Destroy()
if(!owner)
return ..()
if((owner.internal_organs) && (src in owner.internal_organs))
owner.internal_organs -= src
if((owner.internal_organs_by_name) && (src in owner.internal_organs_by_name))
owner.internal_organs_by_name -= src
if((owner.organs) && (src in owner.organs))
owner.organs -= src
if((owner.organs_by_name) && (src in owner.organs_by_name))
owner.organs_by_name -= src
if(src in owner.contents)
owner.contents -= src
return ..()
/obj/item/organ/proc/update_health()
return

View File

@@ -48,6 +48,20 @@
var/can_grasp
var/can_stand
/obj/item/organ/external/Destroy()
if(parent && parent.children)
parent.children -= src
if(children)
for(var/obj/item/organ/external/C in children)
qdel(C)
if(internal_organs)
for(var/obj/item/organ/O in internal_organs)
qdel(O)
return ..()
/obj/item/organ/external/attack_self(var/mob/user)
if(!contents.len)
return ..()

View File

@@ -19,6 +19,11 @@
var/RCon_tag = "NO_TAG"
var/update_locked = 0
/obj/machinery/power/breakerbox/Destroy()
..()
for(var/obj/nano_module/rcon/R in world)
R.FindDevices()
/obj/machinery/power/breakerbox/activated
icon_state = "bbox_on"

View File

@@ -17,6 +17,8 @@
/obj/machinery/power/Destroy()
disconnect_from_network()
disconnect_terminal()
..()
///////////////////////////////

View File

@@ -84,10 +84,12 @@
return
/obj/machinery/power/smes/Destroy()
/obj/machinery/power/smes/disconnect_terminal()
if(terminal)
disconnect_terminal()
..()
terminal.master = null
terminal = null
return 1
return 0
/obj/machinery/power/smes/update_icon()
overlays.Cut()

View File

@@ -75,6 +75,13 @@
charge = 0
should_be_mapped = 1
/obj/machinery/power/smes/buildable/Destroy()
..()
qdel(wires)
for(var/obj/nano_module/rcon/R in world)
R.FindDevices()
// Proc: process()
// Parameters: None
// Description: Uses parent process, but if grounding wire is cut causes sparks to fly around.
@@ -345,6 +352,7 @@
if(I.reliability != 100 && crit_fail)
I.crit_fail = 1
I.loc = src.loc
component_parts -= I
qdel(src)
return