diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 7110ce74e1..1f30726c07 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -16,7 +16,7 @@ /obj/screen/Destroy() master = null - ..() + return ..() /obj/screen/text icon = null diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index 8932175126..066c357a22 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -46,6 +46,10 @@ var/list/wireColours = list("red", "blue", "green", "darkred", "orange", "brown" var/list/wires = same_wires[holder_type] src.wires = wires // Reference the wires list. +/datum/wires/Destroy() + holder = null + return ..() + /datum/wires/proc/GenerateWires() var/list/colours_to_pick = wireColours.Copy() // Get a copy, not a reference. var/list/indexes_to_pick = list() diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 5dc7b13b48..d3603fe96e 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -101,10 +101,9 @@ /obj/machinery/alarm/Destroy() unregister_radio(src, frequency) - if(wires) - qdel(wires) - wires = null - ..() + qdel(wires) + wires = null + return ..() /obj/machinery/alarm/New(var/loc, var/dir, var/building = 0) ..() diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 0956486b69..972d9a717b 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -37,6 +37,11 @@ component_parts += new /obj/item/weapon/stock_parts/manipulator(src) component_parts += new /obj/item/weapon/stock_parts/console_screen(src) RefreshParts() + +/obj/machinery/autolathe/Destroy() + qdel(wires) + wires = null + return ..() /obj/machinery/autolathe/proc/update_recipe_list() if(!machine_recipes) diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index 54f3d2a07f..9e9571b177 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -77,10 +77,13 @@ name = "Mulebot ([suffix])" /obj/machinery/bot/mulebot/Destroy() + unload(0) + qdel(wires) + wires = null if(radio_controller) radio_controller.remove_object(src,beacon_freq) radio_controller.remove_object(src,control_freq) - ..() + return ..() // attack by item // emag : lock/unlock, diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index c2510bbde4..a24a79ac12 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -59,7 +59,8 @@ qdel(assembly) assembly = null qdel(wires) - ..() + wires = null + return ..() /obj/machinery/camera/emp_act(severity) if(!isEmpProof()) @@ -303,7 +304,7 @@ var/turf/pos = get_turf(src) if(!pos) return list() - + if(isXRay()) see = range(view_range, pos) else diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 646488abee..a434f6c780 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1041,10 +1041,9 @@ About the new airlock wires panel: break /obj/machinery/door/airlock/Destroy() - if(wires) - qdel(wires) - wires = null - ..() + qdel(wires) + wires = null + return ..() // Most doors will never be deconstructed over the course of a round, // so as an optimization defer the creation of electronics until diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index bc52c276c3..b1b2cf27f3 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -35,7 +35,8 @@ /obj/machinery/smartfridge/Destroy() qdel(wires) - ..() + wires = null + return ..() /obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj) if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/) || istype(O,/obj/item/seeds/)) diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 2c72743bd2..dd862a7754 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -49,7 +49,7 @@ /obj/machinery/status_display/Destroy() if(radio_controller) radio_controller.remove_object(src,frequency) - ..() + return ..() // register for radio system /obj/machinery/status_display/initialize() diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 63f13ebf75..6d1792e042 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -617,7 +617,7 @@ /obj/machinery/suit_cycler/Destroy() qdel(wires) wires = null - ..() + return ..() /obj/machinery/suit_cycler/engineering name = "Engineering suit cycler" diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index a14b5d2e9a..6a6d4df1fd 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -148,7 +148,7 @@ wires = null qdel(coin) coin = null - ..() + return ..() /obj/machinery/vending/ex_act(severity) switch(severity) diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 7b9f046443..5315942aab 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -33,7 +33,7 @@ qdel(keyslot2) keyslot1 = null keyslot2 = null - ..() + return ..() /obj/item/device/radio/headset/list_channels(var/mob/user) return list_secure_channels() diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 54ebfa85af..b88f34ef51 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -32,7 +32,6 @@ var/global/list/default_medbay_channels = list( var/frequency = PUB_FREQ //common chat var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies var/canhear_range = 3 // the range which mobs can hear this radio from - var/obj/item/device/radio/patch_link = null var/datum/wires/radio/wires = null var/b_stat = 0 var/broadcasting = 0 @@ -71,7 +70,7 @@ var/global/list/default_medbay_channels = list( radio_controller.remove_object(src, frequency) for (var/ch_name in channels) radio_controller.remove_object(src, radiochannels[ch_name]) - ..() + return ..() /obj/item/device/radio/initialize() diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 1d25089eca..8e3fed202d 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -18,6 +18,11 @@ wires = new(src) image_overlay = image('icons/obj/assemblies.dmi', "plastic-explosive2") ..() + +/obj/item/weapon/plastique/Destroy() + qdel(wires) + wires = null + return ..() /obj/item/weapon/plastique/attackby(var/obj/item/I, var/mob/user) if(istype(I, /obj/item/weapon/screwdriver)) diff --git a/code/game/objects/items/weapons/grenades/smokebomb.dm b/code/game/objects/items/weapons/grenades/smokebomb.dm index e1e58b62ac..704df83db8 100644 --- a/code/game/objects/items/weapons/grenades/smokebomb.dm +++ b/code/game/objects/items/weapons/grenades/smokebomb.dm @@ -8,27 +8,32 @@ slot_flags = SLOT_BELT var/datum/effect/effect/system/smoke_spread/bad/smoke - New() - ..() - src.smoke = PoolOrNew(/datum/effect/effect/system/smoke_spread/bad) - src.smoke.attach(src) +/obj/item/weapon/grenade/smokebomb/New() + ..() + src.smoke = PoolOrNew(/datum/effect/effect/system/smoke_spread/bad) + src.smoke.attach(src) - prime() - playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3) - src.smoke.set_up(10, 0, usr.loc) - spawn(0) - src.smoke.start() - sleep(10) - src.smoke.start() - sleep(10) - src.smoke.start() - sleep(10) - src.smoke.start() +/obj/item/weapon/grenade/smokebomb/Destroy() + qdel(smoke) + smoke = null + return ..() - for(var/obj/effect/blob/B in view(8,src)) - var/damage = round(30/(get_dist(B,src)+1)) - B.health -= damage - B.update_icon() - sleep(80) - qdel(src) - return +/obj/item/weapon/grenade/smokebomb/prime() + playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3) + src.smoke.set_up(10, 0, usr.loc) + spawn(0) + src.smoke.start() + sleep(10) + src.smoke.start() + sleep(10) + src.smoke.start() + sleep(10) + src.smoke.start() + + for(var/obj/effect/blob/B in view(8,src)) + var/damage = round(30/(get_dist(B,src)+1)) + B.health -= damage + B.update_icon() + sleep(80) + qdel(src) + return diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index 5452763afb..13d48df5cc 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -160,7 +160,11 @@ M.drop_from_inventory(piece) qdel(piece) processing_objects -= src - ..() + qdel(wires) + wires = null + qdel(spark_system) + spark_system = null + return ..() /obj/item/weapon/rig/proc/suit_is_deployed() if(!istype(wearer) || src.loc != wearer || wearer.back != src) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 1433c5e126..76fe6a8e40 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -214,7 +214,9 @@ mmi = null if(connected_ai) connected_ai.connected_robots -= src - ..() + qdel(wires) + wires = null + return ..() /mob/living/silicon/robot/proc/set_module_sprites(var/list/new_sprites) module_sprites = new_sprites.Copy() diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index b0a5d67bff..3ad0754d84 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -170,21 +170,19 @@ area.power_equip = 0 area.power_environ = 0 area.power_change() - if(wires) - qdel(wires) - wires = null + qdel(wires) + wires = null + qdel(terminal) + terminal = null if(cell) - cell.loc = loc + cell.forceMove(loc) cell = null - if(terminal) - qdel(terminal) - terminal = null // Malf AI, removes the APC from AI's hacked APCs list. if((hacker) && (hacker.hacked_apcs) && (src in hacker.hacked_apcs)) hacker.hacked_apcs -= src - ..() + return ..() /obj/machinery/power/apc/proc/make_terminal() // create a terminal object at the same position as original turf loc @@ -468,7 +466,7 @@ return user.drop_item() - W.loc = src + W.forceMove(src) cell = W user.visible_message(\ "[user.name] has inserted the power cell to [src.name]!",\ diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index e070a5ec90..400e7281b6 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -127,7 +127,7 @@ /obj/machinery/power/port_gen/pacman/Destroy() DropFuel() - ..() + return ..() /obj/machinery/power/port_gen/pacman/RefreshParts() var/temp_rating = 0 @@ -245,11 +245,11 @@ sheets = 0 sheet_left = 0 ..() - + /obj/machinery/power/port_gen/pacman/emag_act(var/remaining_charges, var/mob/user) if (active && prob(25)) explode() //if they're foolish enough to emag while it's running - + if (!emagged) emagged = 1 return 1 diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm index 985bd74e62..39f08f509b 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_control.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm @@ -30,7 +30,9 @@ /obj/machinery/particle_accelerator/control_box/Destroy() if(active) toggle_power() - ..() + qdel(wires) + wires = null + return ..() /obj/machinery/particle_accelerator/control_box/attack_hand(mob/user as mob) if(construction_state >= 3) diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm index 16f3bc9159..497e16a885 100644 --- a/code/modules/power/smes_construction.dm +++ b/code/modules/power/smes_construction.dm @@ -76,11 +76,11 @@ should_be_mapped = 1 /obj/machinery/power/smes/buildable/Destroy() - ..() qdel(wires) + wires = null for(var/datum/nano_module/rcon/R in world) R.FindDevices() - + return ..() // Proc: process() // Parameters: None