Destroy tweaks.

Ports Destroy() proc tweaks from Paradise and /tg/, sourced from https://github.com/ParadiseSS13/Paradise/pull/2091.
Adds returns in Destroy()s, to prepare for future return values.
This commit is contained in:
PsiOmegaDelta
2015-09-25 10:40:05 +02:00
parent 36e61e45bf
commit 9dd1a54191
21 changed files with 85 additions and 58 deletions

View File

@@ -16,7 +16,7 @@
/obj/screen/Destroy()
master = null
..()
return ..()
/obj/screen/text
icon = null

View File

@@ -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()

View File

@@ -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)
..()

View File

@@ -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)

View File

@@ -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,

View File

@@ -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

View File

@@ -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

View File

@@ -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/))

View File

@@ -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()

View File

@@ -617,7 +617,7 @@
/obj/machinery/suit_cycler/Destroy()
qdel(wires)
wires = null
..()
return ..()
/obj/machinery/suit_cycler/engineering
name = "Engineering suit cycler"

View File

@@ -148,7 +148,7 @@
wires = null
qdel(coin)
coin = null
..()
return ..()
/obj/machinery/vending/ex_act(severity)
switch(severity)

View File

@@ -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()

View File

@@ -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()

View File

@@ -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))

View File

@@ -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

View File

@@ -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)

View File

@@ -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()

View File

@@ -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(\
"<span class='warning'>[user.name] has inserted the power cell to [src.name]!</span>",\

View File

@@ -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

View File

@@ -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)

View File

@@ -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