diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm index 5bfe19fd55a..1b801ad3e13 100644 --- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm +++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm @@ -49,10 +49,10 @@ obj/machinery/atmospherics/binary if(node1) node1.disconnect(src) - del(network1) + qdel(network1) if(node2) node2.disconnect(src) - del(network2) + qdel(network2) node1 = null node2 = null diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index 73d28516400..d7756ee51ca 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -229,7 +229,7 @@ for(var/datum/omni_port/P in ports) if(P.node) P.node.disconnect(src) - del(P.network) + qdel(P.network) P.node = null return ..() diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm index 88b2673812c..b2d51336007 100644 --- a/code/ATMOSPHERICS/components/portables_connector.dm +++ b/code/ATMOSPHERICS/components/portables_connector.dm @@ -68,7 +68,7 @@ if(node) node.disconnect(src) - del(network) + qdel(network) node = null diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index 2b629722b91..a2ab2ad9163 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -59,13 +59,13 @@ obj/machinery/atmospherics/trinary if(node1) node1.disconnect(src) - del(network1) + qdel(network1) if(node2) node2.disconnect(src) - del(network2) + qdel(network2) if(node3) node3.disconnect(src) - del(network3) + qdel(network3) node1 = null node2 = null diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm index 6ad768d0df5..70be99d73c3 100644 --- a/code/ATMOSPHERICS/components/tvalve.dm +++ b/code/ATMOSPHERICS/components/tvalve.dm @@ -106,13 +106,13 @@ if(node1) node1.disconnect(src) - del(network_node1) + qdel(network_node1) if(node2) node2.disconnect(src) - del(network_node2) + qdel(network_node2) if(node3) node3.disconnect(src) - del(network_node3) + qdel(network_node3) node1 = null node2 = null diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm index 84405a835ab..5ec065f4ebd 100644 --- a/code/ATMOSPHERICS/components/unary/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary/unary_base.dm @@ -33,7 +33,7 @@ if(node) node.disconnect(src) - del(network) + qdel(network) node = null diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index ba2d6fba96b..88a83d13b13 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -80,10 +80,10 @@ if(node1) node1.disconnect(src) - del(network_node1) + qdel(network_node1) if(node2) node2.disconnect(src) - del(network_node2) + qdel(network_node2) node1 = null node2 = null diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm index 13073fb7407..4b056c645e4 100644 --- a/code/ATMOSPHERICS/datum_pipeline.dm +++ b/code/ATMOSPHERICS/datum_pipeline.dm @@ -12,11 +12,11 @@ datum/pipeline Destroy() if(network) - del(network) + qdel(network) if(air && air.volume) temporarily_store_air() - del(air) + qdel(air) return ..() diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index f035e75c5da..e01ca491233 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -57,7 +57,7 @@ /obj/machinery/atmospherics/pipe/Destroy() - del(parent) + qdel(parent) if(air_temporary && loc) loc.assume_air(air_temporary) diff --git a/code/datums/spells/ethereal_jaunt.dm b/code/datums/spells/ethereal_jaunt.dm index 878aeea8dcd..a1ac834b367 100644 --- a/code/datums/spells/ethereal_jaunt.dm +++ b/code/datums/spells/ethereal_jaunt.dm @@ -59,8 +59,8 @@ break target.canmove = 1 target.client.eye = target - del(animation) - del(holder) + qdel(animation) + qdel(holder) else flick("liquify",animation) target.loc = holder @@ -85,8 +85,8 @@ break target.canmove = 1 target.client.eye = target - del(animation) - del(holder) + qdel(animation) + qdel(holder) /obj/effect/dummy/spell_jaunt name = "water" @@ -96,6 +96,12 @@ density = 0 anchored = 1 +/obj/effect/dummy/spell_jaunt/Destroy() + // Eject contents if deleted somehow + for(var/atom/movable/AM in src) + AM.loc = get_turf(src) + return ..() + /obj/effect/dummy/spell_jaunt/relaymove(var/mob/user, direction) if (!src.canmove) return var/turf/newLoc = get_step(src,direction) diff --git a/code/datums/spells/trigger.dm b/code/datums/spells/trigger.dm index 194110c384c..0ac488f9307 100644 --- a/code/datums/spells/trigger.dm +++ b/code/datums/spells/trigger.dm @@ -14,8 +14,9 @@ /obj/effect/proc_holder/spell/wizard/targeted/trigger/Destroy() for(var/spell in contents) - del(spell) - + qdel(spell) + linked_spells = null + starting_spells = null return ..() /obj/effect/proc_holder/spell/wizard/targeted/trigger/cast(list/targets) diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm index 668901cca0b..fc96912fadf 100644 --- a/code/game/gamemodes/blob/blobs/core.dm +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -23,7 +23,7 @@ Destroy() blob_cores -= src if(overmind) - del(overmind) + qdel(overmind) processing_objects.Remove(src) return ..() diff --git a/code/game/gamemodes/blob/overmind.dm b/code/game/gamemodes/blob/overmind.dm index a7a194885ef..80481cfa39c 100644 --- a/code/game/gamemodes/blob/overmind.dm +++ b/code/game/gamemodes/blob/overmind.dm @@ -30,7 +30,7 @@ /mob/camera/blob/Destroy() if (ghostimage) ghost_darkness_images -= ghostimage - del(ghostimage) + qdel(ghostimage) ghostimage = null; updateallghostimages() return ..() diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index ff04ec4d190..87e44fc04a9 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -115,7 +115,7 @@ /obj/effect/meteor/Destroy() walk(src,0) //this cancels the walk_towards() proc - ..() + return ..() /obj/effect/meteor/New() ..() diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 6fb2fb349a5..833f161f541 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -12,6 +12,10 @@ var/obj/item/weapon/disk/nuclear/the_disk = null var/active = 0 + Destroy() + active = 0 + the_disk = null + return ..() attack_self() if(!active) @@ -377,7 +381,7 @@ /obj/item/weapon/pinpointer/operative/proc/workop() scan_for_ops() point_at(nearest_op, 0) - if(active && nearest_op) + if(active && nearest_op) spawn(5) .() diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm index e368fc3b1eb..f6b39cb5f38 100644 --- a/code/game/machinery/Beacon.dm +++ b/code/game/machinery/Beacon.dm @@ -25,6 +25,7 @@ Destroy() if(Beacon) qdel(Beacon) + Beacon = null return ..() // update the invisibility and icon diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 91eaa41821d..ccc40f29e84 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -147,6 +147,10 @@ first_run() +/obj/machinery/alarm/Destroy() + if(radio_controller) + radio_controller.remove_object(src, frequency) + return ..() /obj/machinery/alarm/proc/first_run() alarm_area = get_area(src) diff --git a/code/game/machinery/atmo_control.dm b/code/game/machinery/atmo_control.dm index 789845a11fe..941e520a3d5 100644 --- a/code/game/machinery/atmo_control.dm +++ b/code/game/machinery/atmo_control.dm @@ -134,6 +134,12 @@ obj/machinery/air_sensor if(radio_controller) set_frequency(frequency) + Destroy() + if(radio_controller) + radio_controller.remove_object(src,frequency) + return ..() + + /obj/machinery/computer/general_air_control icon = 'icons/obj/computer.dmi' icon_screen = "tank" diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm index 4301e311c58..0c6deb622a9 100644 --- a/code/game/machinery/atmoalter/meter.dm +++ b/code/game/machinery/atmoalter/meter.dm @@ -23,6 +23,10 @@ id_tag = id return 1 +/obj/machinery/meter/Destroy() + src.target = null + return ..() + /obj/machinery/meter/initialize() if (!target) src.target = locate(/obj/machinery/atmospherics/pipe) in loc @@ -86,13 +90,13 @@ /obj/machinery/meter/examine() var/t = "A gas flow meter. " - + if(get_dist(usr, src) > 3 && !(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/dead))) t += "\blue You are too far away to read it." - + else if(stat & (NOPOWER|BROKEN)) - t += "\red The display is off." - + t += "\red The display is off." + else if(src.target) var/datum/gas_mixture/environment = target.return_air() if(environment) @@ -101,14 +105,14 @@ t += "The sensor error light is blinking." else t += "The connect error light is blinking." - + usr << t /obj/machinery/meter/Click() if(istype(usr, /mob/living/silicon/ai)) // ghosts can call ..() for examine src.examine() return 1 - + return ..() /obj/machinery/meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm index f8629b47251..b1b13220d56 100644 --- a/code/game/machinery/atmoalter/portable_atmospherics.dm +++ b/code/game/machinery/atmoalter/portable_atmospherics.dm @@ -35,7 +35,7 @@ update_icon() Destroy() - del(air_contents) + qdel(air_contents) return ..() diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 10835470300..0c16939a97f 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -59,7 +59,7 @@ if(bug.current == src) bug.current = null bug = null - del(wires) + qdel(wires) cameranet.removeCamera(src) //Will handle removal from the camera network and the chunks, so we don't need to worry about that return ..() diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index 4e53fe36699..09830ef180f 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -119,5 +119,6 @@ return /obj/machinery/computer/atmos_alert/Destroy() - radio_controller.remove_object(src, receive_frequency) + if(radio_controller) + radio_controller.remove_object(src, receive_frequency) return ..() diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index ae3b91c3ca3..982f0e415ff 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -72,6 +72,7 @@ var/obj/item/weapon/reagent_containers/glass/B = beaker if(beaker) B.loc = get_step(T, SOUTH) //Beaker is carefully ejected from the wreckage of the cryotube + beaker = null return ..() /obj/machinery/atmospherics/unary/cryo_cell/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index e731689cbba..a8c2491ab04 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -25,6 +25,9 @@ density = 0 if(health == 0) playsound(src, "shatter", 70, 1) + if(electronics) + qdel(electronics) + electronics = null return ..() diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 876e1404411..eef7223d15b 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -116,6 +116,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co /obj/machinery/newscaster/Destroy() allCasters -= src + viewing_channel = null + photo = null return ..() /obj/machinery/newscaster/update_icon() diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 65c41918e6c..0a71b73e8ef 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -157,6 +157,7 @@ /obj/machinery/porta_turret/Destroy() //deletes its own cover with it qdel(cover) // qdel + cover = null return ..() /obj/machinery/porta_turret/proc/isLocked(mob/user) diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index c5c61e87c69..cb0c9707b32 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -140,6 +140,7 @@ /obj/machinery/shieldgen/Destroy() for(var/obj/machinery/shield/shield_tile in deployed_shields) qdel(shield_tile) + deployed_shields = null return ..() diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 38a8a7d31de..7285c12ccd9 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -22,6 +22,12 @@ /obj/machinery/computer/teleporter/initialize() link_power_station() +/obj/machinery/computer/teleporter/Destroy() + if (power_station) + power_station.teleporter_console = null + power_station = null + return ..() + /obj/machinery/computer/teleporter/proc/link_power_station() if(power_station) return @@ -36,14 +42,11 @@ var/obj/item/device/gps/L = I if(L.locked_location && !(stat & (NOPOWER|BROKEN))) if(!user.unEquip(L)) - user << "\the [I] is stuck to your hand, you cannot put it in \the [src]" + user << "\the [I] is stuck to your hand, you cannot put it in \the [src]" return L.loc = src locked = L user << "You insert the GPS device into the [name]'s slot." - src.attack_hand(user) - else - user << "No useable data was found on te GPS device." else ..() return @@ -165,7 +168,7 @@ /obj/machinery/computer/teleporter/proc/eject() if(locked) - locked.loc = src.loc + locked.loc = loc locked = null /obj/machinery/computer/teleporter/proc/set_target(mob/user) @@ -291,6 +294,12 @@ /obj/machinery/teleport/hub/initialize() link_power_station() +/obj/machinery/teleport/hub/Destroy() + if (power_station) + power_station.teleporter_hub = null + power_station = null + return ..() + /obj/machinery/teleport/hub/RefreshParts() var/A = 0 for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts) @@ -340,7 +349,7 @@ if (!com) return if (!com.target) - visible_message("Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.") + visible_message("Cannot authenticate locked on coordinates. Please reinstate coordinate matrix.") return if (istype(M, /atom/movable)) if(!calibrated && prob(25 - ((accurate) * 10))) //oh dear a problem @@ -408,7 +417,12 @@ /obj/machinery/teleport/station/Destroy() if(teleporter_hub) + teleporter_hub.power_station = null teleporter_hub.update_icon() + teleporter_hub = null + if (teleporter_console) + teleporter_console.power_station = null + teleporter_console = null return ..() /obj/machinery/teleport/station/attackby(var/obj/item/weapon/W, mob/user, params) @@ -420,8 +434,9 @@ M.buffer = null user << "You upload the data from the [W.name]'s buffer." else - user << "This station cant hold more information, try to use better parts." + user << "This station can't hold more information, try to use better parts." if(default_deconstruction_screwdriver(user, "controller-o", "controller", W)) + update_icon() return if(exchange_parts(user, W)) @@ -468,10 +483,9 @@ /obj/machinery/teleport/station/power_change() ..() - if(stat & NOPOWER) - update_icon() - if(teleporter_hub) - teleporter_hub.update_icon() + update_icon() + if(teleporter_hub) + teleporter_hub.update_icon() /obj/machinery/teleport/station/update_icon() if(panel_open) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 01fb3ddd701..cefb8a194b4 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -146,10 +146,10 @@ src.product_records.Add(product) /obj/machinery/vending/Destroy() - del(wires) // qdel + qdel(wires) // qdel wires = null if(coin) - del(coin) // qdel + qdel(coin) // qdel coin = null return ..() diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 8312fc0f328..e895e2f3ad2 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -72,7 +72,7 @@ /obj/structure/alien/resin/proc/healthcheck() if(health <=0) - del(src) + qdel(src) /obj/structure/alien/resin/bullet_act(obj/item/projectile/Proj) @@ -167,7 +167,7 @@ ..() linked_node = node if(istype(loc, /turf/space)) - del(src) + qdel(src) return if(icon_state == "weeds") icon_state = pick("weeds", "weeds1", "weeds2") @@ -178,9 +178,9 @@ /obj/structure/alien/weeds/Destroy() var/turf/T = loc - loc = null for (var/obj/structure/alien/weeds/W in range(1,T)) W.updateWeedOverlays() + linked_node = null return ..() /obj/structure/alien/weeds/proc/Life() @@ -188,7 +188,7 @@ var/turf/U = get_turf(src) if(istype(U, /turf/space)) - del(src) + qdel(src) return direction_loop: @@ -232,7 +232,7 @@ /obj/structure/alien/weeds/proc/healthcheck() if(health <= 0) - del(src) + qdel(src) /obj/structure/alien/weeds/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) @@ -315,7 +315,7 @@ if(BURST) user << "You clear the hatched egg." playsound(loc, 'sound/effects/attackblob.ogg', 100, 1) - del(src) + qdel(src) return if(GROWING) user << "The child is not developed yet." @@ -390,7 +390,7 @@ if(status != BURST && status != BURSTING) Burst() else if(status == BURST && prob(50)) - del(src) //Remove the egg after it has been hit after bursting. + qdel(src) //Remove the egg after it has been hit after bursting. /obj/structure/alien/egg/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) @@ -453,7 +453,7 @@ /obj/effect/acid/proc/tick() if(!target) - del(src) + qdel(src) ticks++ @@ -464,9 +464,9 @@ var/turf/simulated/wall/W = target W.dismantle_wall(1) else - del(target) + qdel(target) - del(src) + qdel(src) return x = target.x diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index fea98e5f472..c2945ca8b9b 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -21,11 +21,6 @@ var/global/list/image/splatter_cache=list() var/list/datum/disease2/disease/virus2 = list() var/amount = 5 -/obj/effect/decal/cleanable/blood/Destroy() - for(var/datum/disease2/disease/D in viruses) - D.cure(0) - return ..() - /obj/effect/decal/cleanable/blood/New() ..() update_icon() diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index de79a855768..0e83d0fa1ce 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -123,4 +123,4 @@ else spawn(25) can_move = 1 step(src,direction) - return \ No newline at end of file + return diff --git a/code/game/objects/items/devices/guitar.dm b/code/game/objects/items/devices/guitar.dm index e8aa4e3dd6d..fa6a7dbc3f3 100644 --- a/code/game/objects/items/devices/guitar.dm +++ b/code/game/objects/items/devices/guitar.dm @@ -16,7 +16,7 @@ song.instrumentExt = "ogg" /obj/item/device/guitar/Destroy() - del(song) + qdel(song) song = null return ..() diff --git a/code/game/objects/items/devices/violin.dm b/code/game/objects/items/devices/violin.dm index 99288450a9b..5891b163794 100644 --- a/code/game/objects/items/devices/violin.dm +++ b/code/game/objects/items/devices/violin.dm @@ -15,7 +15,7 @@ song.instrumentExt = "ogg" /obj/item/device/violin/Destroy() - del(song) + qdel(song) song = null return ..() diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 18283f81efe..2736ccd4260 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -22,7 +22,7 @@ return /obj/item/stack/Destroy() - if (src && usr && usr.machine==src) + if (usr && usr.machine==src) usr << browse(null, "window=stack") return ..() diff --git a/code/game/objects/items/weapons/cigs.dm b/code/game/objects/items/weapons/cigs.dm index efa5684027d..8724d2663ee 100644 --- a/code/game/objects/items/weapons/cigs.dm +++ b/code/game/objects/items/weapons/cigs.dm @@ -37,8 +37,8 @@ LIGHTERS ARE IN LIGHTERS.DM create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 30 /obj/item/clothing/mask/cigarette/Destroy() - . = ..() - del(reagents) + qdel(reagents) + return ..() /obj/item/clothing/mask/cigarette/attackby(obj/item/weapon/W as obj, mob/user as mob, params) ..() diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index 2faf8a19083..1cea34da688 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -165,8 +165,13 @@ if(on) var/M = get(paddles, /mob) remove_paddles(M) - . = ..() - update_icon() + if(paddles) + qdel(paddles) + paddles = null + if(bcell) + qdel(bcell) + bcell = null + return ..() /obj/item/weapon/defibrillator/proc/deductcharge(var/chrgdeductamt) if(bcell) diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm index e7986575e8e..200115be01d 100644 --- a/code/game/objects/items/weapons/storage/fancy.dm +++ b/code/game/objects/items/weapons/storage/fancy.dm @@ -182,7 +182,7 @@ /obj/item/weapon/storage/fancy/cigarettes/Destroy() - del(reagents) + qdel(reagents) return ..() diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index eb5717f43ff..40782759603 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -441,6 +441,11 @@ orient2hud() return +/obj/item/weapon/storage/Destroy() + qdel(boxes) + qdel(closer) + return ..() + /obj/item/weapon/storage/emp_act(severity) if(!istype(src.loc, /mob/living)) for(var/obj/O in contents) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 624c1c345c0..f493fa53726 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -33,7 +33,7 @@ /obj/item/weapon/tank/Destroy() if(air_contents) - del(air_contents) + qdel(air_contents) processing_objects.Remove(src) diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index fcf1424b209..37c18f020b1 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -23,6 +23,7 @@ air_update_turf(1) Destroy() + density = 0 air_update_turf(1) return ..() diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index 165436ba3ee..b1a47c474d9 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -318,7 +318,7 @@ icon_state = "piano" /obj/structure/piano/Destroy() - del(song) + qdel(song) song = null return ..() diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index de51f62114d..06e878f5d2f 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -36,7 +36,7 @@ ..() for(var/obj/structure/table/T in src.loc) if(T != src) - del(T) + qdel(T) update_icon() update_adjacent() @@ -410,7 +410,7 @@ G.affecting.loc = src.loc G.affecting.Weaken(5) visible_message("\red [G.assailant] puts [G.affecting] on \the [src].") - del(W) + qdel(W) return if (istype(W, /obj/item/weapon/wrench)) @@ -562,9 +562,9 @@ /obj/structure/table/woodentable/attackby(obj/item/I as obj, mob/user as mob, params) if (istype(I, /obj/item/stack/tile/grass)) - del(I) + qdel(I) new /obj/structure/table/woodentable/poker( src.loc ) - del(src) + qdel(src) visible_message("[user] adds the grass to the wooden table") @@ -581,7 +581,7 @@ G.affecting.loc = src.loc G.affecting.Weaken(5) visible_message("\red [G.assailant] puts [G.affecting] on the table.") - del(I) + qdel(I) return if (istype(I, /obj/item/weapon/wrench)) user << "\blue Now disassembling the wooden table" @@ -589,7 +589,7 @@ sleep(50) new /obj/item/weapon/table_parts/wood( src.loc ) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) - del(src) + qdel(src) return if(isrobot(user)) @@ -603,7 +603,7 @@ for(var/mob/O in viewers(user, 4)) O.show_message("\blue The wooden table was sliced apart by [user]!", 1, "\red You hear wood coming apart.", 2) new /obj/item/weapon/table_parts/wood( src.loc ) - del(src) + qdel(src) return if(!(I.flags & ABSTRACT)) @@ -640,7 +640,7 @@ G.affecting.loc = src.loc G.affecting.Weaken(5) visible_message("\red [G.assailant] puts [G.affecting] on the table.") - del(W) + qdel(W) return if (istype(W, /obj/item/weapon/wrench)) user << "\blue Now disassembling the wooden table" @@ -649,7 +649,7 @@ new /obj/item/weapon/table_parts/wood( src.loc ) new /obj/item/stack/tile/grass( src.loc) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) - del(src) + qdel(src) return if(isrobot(user)) @@ -664,7 +664,7 @@ O.show_message("\blue The wooden table was sliced apart by [user]!", 1, "\red You hear wood coming apart.", 2) new /obj/item/weapon/table_parts/wood( src.loc ) new /obj/item/stack/tile/grass( src.loc) - del(src) + qdel(src) return if(!(W.flags & ABSTRACT)) @@ -697,7 +697,7 @@ user << "You add the glass to \the [src]." playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1) new /obj/structure/table/glass(loc) - del(src) + qdel(src) else user << "You don't have enough glass! You need at least 2 sheets." return @@ -710,7 +710,7 @@ user << "You dismantle \the [src]." new /obj/item/stack/sheet/metal(loc) new /obj/item/stack/sheet/metal(loc) - del(src) + qdel(src) /obj/structure/table/glass name = "glass table" @@ -745,7 +745,7 @@ G.affecting.loc = src.loc G.affecting.Weaken(7) visible_message("[G.assailant] smashes [G.affecting] onto \the [src]!") - del(I) + qdel(I) src.collapse() return @@ -756,7 +756,7 @@ new /obj/item/weapon/table_parts/glass( src.loc ) new /obj/item/stack/sheet/glass( src.loc ) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) - del(src) + qdel(src) return if(isrobot(user)) @@ -771,7 +771,7 @@ O.show_message("\The [src] was sliced apart by [user]!", 1, "You hear glass being sliced apart.", 2) new /obj/item/weapon/table_parts/glass( src.loc ) new /obj/item/stack/sheet/glass( src.loc ) - del(src) + qdel(src) return if(!(I.flags & ABSTRACT)) @@ -848,7 +848,7 @@ /obj/structure/rack/proc/destroy() new parts(loc) density = 0 - del(src) + qdel(src) /obj/structure/rack/ex_act(severity) switch(severity) @@ -865,11 +865,11 @@ /obj/structure/rack/blob_act() if(prob(75)) - del(src) + qdel(src) return else if(prob(50)) new /obj/item/weapon/rack_parts(src.loc) - del(src) + qdel(src) return /obj/structure/rack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) @@ -896,7 +896,7 @@ if (istype(W, /obj/item/weapon/wrench)) new /obj/item/weapon/rack_parts( src.loc ) playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - del(src) + qdel(src) return if(isrobot(user)) return diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 4855c0d1f84..f69fc7d05a7 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -21,6 +21,9 @@ if(config) update_starlight() //MC will initialize all the space turfs that get created before config +/turf/space/Destroy() + return QDEL_HINT_LETMELIVE + /turf/space/proc/update_starlight() if(!config) return if(!config.starlight) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 53b96f7e4a0..1d212cdc7f6 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -40,6 +40,9 @@ src.Entered(AM) return +/turf/Destroy() + return QDEL_HINT_HARDDEL_NOW + // Adds the adjacent turfs to the current atmos processing /turf/Del() if(air_master) diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm index 049b87640ee..885b163e47a 100644 --- a/code/modules/assembly/shock_kit.dm +++ b/code/modules/assembly/shock_kit.dm @@ -10,8 +10,8 @@ flags = CONDUCT /obj/item/assembly/shock_kit/Destroy() - del(part1) - del(part2) + qdel(part1) + qdel(part2) return ..() /obj/item/assembly/shock_kit/attackby(obj/item/weapon/W as obj, mob/user as mob, params) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index deec9c8ea7e..713a6dcc6b3 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -89,7 +89,7 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi /mob/dead/observer/Destroy() if (ghostimage) ghost_darkness_images -= ghostimage - del(ghostimage) + qdel(ghostimage) ghostimage = null updateallghostimages() return ..() diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm index 8b2060cf554..937fe0a0ad7 100644 --- a/code/modules/mob/living/carbon/brain/MMI.dm +++ b/code/modules/mob/living/carbon/brain/MMI.dm @@ -165,3 +165,12 @@ if(3) brainmob.emp_damage += rand(0,10) ..() + +/obj/item/device/mmi/Destroy() + if(isrobot(loc)) + var/mob/living/silicon/robot/borg = loc + borg.mmi = null + if(brainmob) + qdel(brainmob) + brainmob = null + return ..() diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm index 4472f9329c9..22e38613553 100644 --- a/code/modules/mob/living/carbon/brain/brain_item.dm +++ b/code/modules/mob/living/carbon/brain/brain_item.dm @@ -88,4 +88,10 @@ name = "chem" desc = "A tightly furled roll of paper, covered with indecipherable runes." icon = 'icons/obj/wizard.dmi' - icon_state = "scroll" \ No newline at end of file + icon_state = "scroll" + +/obj/item/organ/brain/Destroy() //copypasted from MMIs. + if(brainmob) + qdel(brainmob) + brainmob = null + return ..() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 609c5afe269..aec5a9ad082 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -6,6 +6,13 @@ mob/living update_hud() return +/mob/living/carbon/Destroy() + for(var/atom/movable/guts in internal_organs) + qdel(guts) + for(var/atom/movable/food in stomach_contents) + qdel(food) + return ..() + /mob/living/carbon/Life() ..() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 93199dce0c2..3fabd2ef851 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -50,6 +50,12 @@ dna.ready_dna(src) UpdateAppearance() +/mob/living/carbon/human/Destroy() + for(var/atom/movable/organelle in organs) + qdel(organelle) + organs = list() + return ..() + /mob/living/carbon/human/dummy real_name = "Test Dummy" status_flags = GODMODE|CANPUSH diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index ca944feb713..4d9661c92d7 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1,4 +1,8 @@ +/mob/living/Destroy() + ..() + return QDEL_HINT_HARDDEL_NOW + /mob/living/Life() ..() if (notransform) return diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index 4397b63223e..dfa605a1fa6 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -26,7 +26,7 @@ /mob/aiEye/Destroy() if (ghostimage) ghost_darkness_images -= ghostimage - del(ghostimage) + qdel(ghostimage) ghostimage = null; updateallghostimages() return ..() diff --git a/code/modules/mob/living/silicon/robot/component.dm b/code/modules/mob/living/silicon/robot/component.dm index 25b6cddc1c7..9673a766f72 100644 --- a/code/modules/mob/living/silicon/robot/component.dm +++ b/code/modules/mob/living/silicon/robot/component.dm @@ -24,7 +24,7 @@ /datum/robot_component/proc/destroy() if(wrapped) - del wrapped + qdel(wrapped) wrapped = new/obj/item/broken_device diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 3ae26fea4cf..b826e2e0a34 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -174,11 +174,19 @@ var/list/robot_verbs_default = list( //If there's an MMI in the robot, have it ejected when the mob goes away. --NEO //Improved /N /mob/living/silicon/robot/Destroy() - if(mmi)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside. + if(mmi && mind)//Safety for when a cyborg gets dust()ed. Or there is no MMI inside. var/turf/T = get_turf(loc)//To hopefully prevent run time errors. if(T) mmi.loc = T - if(mind) mind.transfer_to(mmi.brainmob) + if(mmi.brainmob) + mind.transfer_to(mmi.brainmob) + mmi.update_icon() + else + src << "Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug." + ghostize() + error("A borg has been destroyed, but its MMI lacked a brainmob, so the mind could not be transferred. Player: [ckey].") mmi = null + if(connected_ai) + connected_ai.connected_robots -= src return ..() /mob/living/silicon/robot/proc/pick_module() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index e0c6b9128de..1a42d6f9614 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -2,6 +2,9 @@ mob_list -= src dead_mob_list -= src living_mob_list -= src + qdel(hud_used) + if(mind && mind.current == src) + spellremove(src) ghostize() return ..() diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index d8570e289d2..78bda4169b3 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1330,6 +1330,9 @@ obj/machinery/power/apc/proc/autoset(var/val, var/on) area.power_change() if(occupant) malfvacate(1) + qdel(wires) + if(cell) + qdel(cell) return ..() /obj/machinery/power/apc/proc/shock(mob/user, prb) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index 482395a852d..8b309343c5f 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -72,7 +72,7 @@ /obj/machinery/power/supermatter_shard/Destroy() investigate_log("has been destroyed.", "supermatter") qdel(radio) - . = ..() + return ..() /obj/machinery/power/supermatter_shard/proc/explode() investigate_log("has exploded.", "supermatter") diff --git a/code/modules/projectiles/guns/energy/temperature.dm b/code/modules/projectiles/guns/energy/temperature.dm index ffc680a151a..5db53cc5a84 100644 --- a/code/modules/projectiles/guns/energy/temperature.dm +++ b/code/modules/projectiles/guns/energy/temperature.dm @@ -19,7 +19,7 @@ Destroy() processing_objects.Remove(src) - ..() + return ..() attack_self(mob/living/user as mob) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 8da0bd3d403..3b57147aba8 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -678,7 +678,7 @@ for(var/atom/movable/AM in H) AM.loc = T AM.pipe_eject(0) - del(H) + qdel(H) ..() return