Converts Most Destroys to use QDEL_NULL

This commit is contained in:
Fox-McCloud
2017-04-04 23:08:41 -04:00
parent ba8b1dae55
commit 5631d36ff8
121 changed files with 217 additions and 468 deletions
+1 -3
View File
@@ -36,9 +36,7 @@
to_chat(user, "This is a [generation]\th generation [name]!")
/obj/structure/glowshroom/Destroy()
if(myseed)
qdel(myseed)
myseed = null
QDEL_NULL(myseed)
return ..()
/obj/structure/glowshroom/New(loc, obj/item/seeds/newseed, mutate_stats)
+1 -3
View File
@@ -19,9 +19,7 @@
ID.access = get_region_accesses(region_access)
/obj/item/weapon/door_remote/Destroy()
if(ID)
qdel(ID)
ID = null
QDEL_NULL(ID)
return ..()
/obj/item/weapon/door_remote/attack_self(mob/user)
+1 -2
View File
@@ -17,8 +17,7 @@
song.instrumentExt = "ogg"
/obj/item/device/guitar/Destroy()
qdel(song)
song = null
QDEL_NULL(song)
return ..()
/obj/item/device/guitar/attack_self(mob/user as mob)
@@ -35,9 +35,7 @@
pointer_icon_state = pick("red_laser","green_laser","blue_laser","purple_laser")
/obj/item/device/laser_pointer/Destroy()
if(diode)
qdel(diode)
diode = null
QDEL_NULL(diode)
return ..()
/obj/item/device/laser_pointer/upgraded/New()
+2 -4
View File
@@ -12,7 +12,7 @@
var/looking_for_personality = 0
var/mob/living/silicon/pai/pai
var/list/faction = list("neutral") // The factions the pAI will inherit from the card
/obj/item/device/paicard/syndicate
name = "syndicate personal AI device"
faction = list("syndicate")
@@ -33,9 +33,7 @@
pai.ghostize()
qdel(pai)
pai = null
if(radio)
qdel(radio)
radio = null
QDEL_NULL(radio)
return ..()
/obj/item/device/paicard/attack_self(mob/user)
@@ -12,8 +12,7 @@
crew_monitor = new(src)
/obj/item/device/sensor_device/Destroy()
qdel(crew_monitor)
crew_monitor = null
QDEL_NULL(crew_monitor)
return ..()
/obj/item/device/sensor_device/attack_self(mob/user as mob)
@@ -21,9 +21,7 @@
update_icon()
/obj/item/device/taperecorder/Destroy()
if(mytape)
qdel(mytape)
mytape = null
QDEL_NULL(mytape)
return ..()
/obj/item/device/taperecorder/examine(mob/user)
@@ -13,15 +13,9 @@
origin_tech = "materials=1;engineering=1"
/obj/item/device/transfer_valve/Destroy()
if(tank_one)
qdel(tank_one)
tank_one = null
if(tank_two)
qdel(tank_two)
tank_two = null
if(attached_device)
qdel(attached_device)
attached_device = null
QDEL_NULL(tank_one)
QDEL_NULL(tank_two)
QDEL_NULL(attached_device)
attacher = null
return ..()
+1 -2
View File
@@ -18,8 +18,7 @@
song.instrumentExt = "ogg"
/obj/item/device/violin/Destroy()
qdel(song)
song = null
QDEL_NULL(song)
return ..()
/obj/item/device/violin/initialize()
+1 -3
View File
@@ -12,9 +12,7 @@
var/datum/gas_mixture/air_contents = null
/obj/item/latexballon/Destroy()
if(air_contents)
qdel(air_contents)
air_contents = null
QDEL_NULL(air_contents)
return ..()
/obj/item/latexballon/proc/blow(obj/item/weapon/tank/tank, mob/user)
+1 -2
View File
@@ -59,8 +59,7 @@ RCD
return
/obj/item/weapon/rcd/Destroy()
qdel(spark_system)
spark_system = null
QDEL_NULL(spark_system)
rcd_list -= src
return ..()
+1 -3
View File
@@ -62,9 +62,7 @@
to_chat(user, "<span class='info'>It contains [loaded.amount]/[max_amount] cables.</span>")
/obj/item/weapon/twohanded/rcl/Destroy()
if(loaded)
qdel(loaded)
loaded = null
QDEL_NULL(loaded)
last = null
active = 0
return ..()
+1 -3
View File
@@ -46,9 +46,7 @@ LIGHTERS ARE IN LIGHTERS.DM
reagents.set_reacting(FALSE) // so it doesn't react until you light it
/obj/item/clothing/mask/cigarette/Destroy()
if(reagents)
qdel(reagents)
reagents = null
QDEL_NULL(reagents)
processing_objects -= src
return ..()
+2 -6
View File
@@ -172,12 +172,8 @@
if(on)
var/M = get(paddles, /mob)
remove_paddles(M)
if(paddles)
qdel(paddles)
paddles = null
if(bcell)
qdel(bcell)
bcell = null
QDEL_NULL(paddles)
QDEL_NULL(bcell)
return ..()
/obj/item/weapon/defibrillator/proc/deductcharge(var/chrgdeductamt)
@@ -18,9 +18,7 @@
..()
/obj/item/weapon/grenade/plastic/Destroy()
if(nadeassembly)
qdel(nadeassembly)
nadeassembly = null
QDEL_NULL(nadeassembly)
target = null
return ..()
@@ -25,15 +25,9 @@
/obj/item/weapon/flamethrower/Destroy()
if(weldtool)
qdel(weldtool)
weldtool = null
if(igniter)
qdel(igniter)
igniter = null
if(ptank)
qdel(ptank)
ptank = null
QDEL_NULL(weldtool)
QDEL_NULL(igniter)
QDEL_NULL(ptank)
previousturf = null
return ..()
@@ -27,9 +27,7 @@
update_icon()
/obj/item/weapon/grenade/chem_grenade/Destroy()
if(nadeassembly)
qdel(nadeassembly)
nadeassembly = null
QDEL_NULL(nadeassembly)
for(var/thing in beakers)
qdel(thing)
beakers.Cut()
+2 -6
View File
@@ -27,12 +27,8 @@
icon_state = "[initial(icon_state)][armed]"
/obj/item/weapon/restraints/legcuffs/beartrap/Destroy()
if(IED)
qdel(IED)
IED = null
if(sig)
qdel(sig)
sig = null
QDEL_NULL(IED)
QDEL_NULL(sig)
return ..()
/obj/item/weapon/restraints/legcuffs/beartrap/suicide_act(mob/user)
@@ -17,9 +17,7 @@
var/pressureSetting = 1 //How powerful the cannon is - higher pressure = more gas but more powerful throws
/obj/item/weapon/pneumatic_cannon/Destroy()
if(tank)
qdel(tank)
tank = null
QDEL_NULL(tank)
for(var/obj/item/I in loadedItems)
qdel(I)
loadedItems.Cut()
+1 -3
View File
@@ -17,9 +17,7 @@
/obj/item/weapon/melee/powerfist/Destroy()
if(tank)
qdel(tank)
tank = null
QDEL_NULL(tank)
return ..()
/obj/item/weapon/melee/powerfist/examine(mob/user)
@@ -186,7 +186,7 @@
/obj/item/weapon/storage/fancy/cigarettes/Destroy()
qdel(reagents)
QDEL_NULL(reagents)
return ..()
@@ -454,8 +454,8 @@
for(var/obj/O in contents)
O.mouse_opacity = initial(O.mouse_opacity)
qdel(boxes)
qdel(closer)
QDEL_NULL(boxes)
QDEL_NULL(closer)
return ..()
/obj/item/weapon/storage/emp_act(severity)
+2 -6
View File
@@ -24,9 +24,7 @@
return
/obj/item/weapon/melee/baton/Destroy()
if(bcell)
qdel(bcell)
bcell = null
QDEL_NULL(bcell)
return ..()
/obj/item/weapon/melee/baton/loaded/New() //this one starts with a cell pre-installed.
@@ -208,9 +206,7 @@
sparkler = new(src)
/obj/item/weapon/melee/baton/cattleprod/Destroy()
if(sparkler)
qdel(sparkler)
sparkler = null
QDEL_NULL(sparkler)
return ..()
/obj/item/weapon/melee/baton/cattleprod/baton_stun()
@@ -19,8 +19,7 @@
ion_trail.set_up(src)
/obj/item/weapon/tank/jetpack/Destroy()
qdel(ion_trail)
ion_trail = null
QDEL_NULL(ion_trail)
return ..()
/obj/item/weapon/tank/jetpack/ui_action_click(mob/user, actiontype)
@@ -82,7 +81,7 @@
var/datum/gas_mixture/removed = air_contents.remove(num)
if(removed.total_moles() < 0.005)
turn_off()
turn_off()
return 0
var/turf/T = get_turf(user)
@@ -33,9 +33,7 @@
return
/obj/item/weapon/tank/Destroy()
if(air_contents)
qdel(air_contents)
air_contents = null
QDEL_NULL(air_contents)
processing_objects.Remove(src)
+1 -3
View File
@@ -20,9 +20,7 @@
var/obj/item/weapon/canvas/painting = null
/obj/structure/easel/Destroy()
if(painting)
qdel(painting)
painting = null
QDEL_NULL(painting)
return ..()
//Adding canvases
+3 -8
View File
@@ -23,12 +23,8 @@ var/global/list/captain_display_cases = list()
var/state = DISPLAYCASE_FRAME_CIRCUIT
/obj/structure/displaycase_frame/Destroy()
if(circuit)
qdel(circuit)
circuit = null
if(sensor)
qdel(sensor)
sensor = null
QDEL_NULL(circuit)
QDEL_NULL(sensor)
return ..()
/obj/structure/displaycase_frame/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
@@ -125,8 +121,7 @@ var/global/list/captain_display_cases = list()
/obj/structure/displaycase/Destroy()
dump()
qdel(circuit)
circuit = null
QDEL_NULL(circuit)
return ..()
/obj/structure/displaycase/captains_laser/Destroy()
@@ -18,9 +18,7 @@
update_state()
/obj/structure/door_assembly/Destroy()
if(electronics)
qdel(electronics)
electronics = null
QDEL_NULL(electronics)
return ..()
/obj/structure/door_assembly/door_assembly_com
+8 -24
View File
@@ -15,30 +15,14 @@
var/obj/item/taperoll/engineering/myengitape = null
/obj/structure/engineeringcart/Destroy()
if(myglass)
qdel(myglass)
myglass = null
if(mymetal)
qdel(mymetal)
mymetal = null
if(myplasteel)
qdel(myplasteel)
myplasteel = null
if(myflashlight)
qdel(myflashlight)
myflashlight = null
if(mybluetoolbox)
qdel(mybluetoolbox)
mybluetoolbox = null
if(myyellowtoolbox)
qdel(myyellowtoolbox)
myyellowtoolbox = null
if(myredtoolbox)
qdel(myredtoolbox)
myredtoolbox = null
if(myengitape)
qdel(myengitape)
myengitape = null
QDEL_NULL(myglass)
QDEL_NULL(mymetal)
QDEL_NULL(myplasteel)
QDEL_NULL(myflashlight)
QDEL_NULL(mybluetoolbox)
QDEL_NULL(myyellowtoolbox)
QDEL_NULL(myredtoolbox)
QDEL_NULL(myengitape)
return ..()
/obj/structure/engineeringcart/proc/put_in_cart(obj/item/I, mob/user)
+1 -3
View File
@@ -9,9 +9,7 @@
var/opened = 0
/obj/structure/extinguisher_cabinet/Destroy()
if(has_extinguisher)
qdel(has_extinguisher)
has_extinguisher = null
QDEL_NULL(has_extinguisher)
return ..()
/obj/structure/extinguisher_cabinet/attackby(obj/item/O, mob/user, params)
+4 -12
View File
@@ -25,18 +25,10 @@
/obj/structure/janitorialcart/Destroy()
janitorial_equipment -= src
if(mybag)
qdel(mybag)
mybag = null
if(mymop)
qdel(mymop)
mymop = null
if(myspray)
qdel(myspray)
myspray = null
if(myreplacer)
qdel(myreplacer)
myreplacer = null
QDEL_NULL(mybag)
QDEL_NULL(mymop)
QDEL_NULL(myspray)
QDEL_NULL(myreplacer)
return ..()
/obj/structure/janitorialcart/proc/wet_mop(obj/item/weapon/mop, mob/user)
+4 -8
View File
@@ -160,9 +160,7 @@
return
/obj/structure/morgue/Destroy()
if(connected)
qdel(connected)
connected = null
QDEL_NULL(connected)
return ..()
/obj/structure/morgue/container_resist(var/mob/living/L)
@@ -405,9 +403,7 @@
return
/obj/structure/crematorium/Destroy()
if(connected)
qdel(connected)
connected = null
QDEL_NULL(connected)
return ..()
/obj/structure/crematorium/container_resist(var/mob/living/L)
@@ -471,7 +467,7 @@
connected.connected = null
connected = null
return ..()
// Crematorium switch
/obj/machinery/crema_switch
desc = "Burn baby burn!"
@@ -484,7 +480,7 @@
var/area/area = null
var/otherarea = null
var/id = 1
/obj/machinery/crema_switch/attack_ghost(mob/user)
if(user.can_advanced_admin_interact())
return attack_hand(user)
+1 -2
View File
@@ -281,8 +281,7 @@
icon_state = "piano"
/obj/structure/piano/Destroy()
qdel(song)
song = null
QDEL_NULL(song)
return ..()
/obj/structure/piano/initialize()
+1 -3
View File
@@ -9,9 +9,7 @@
var/obj/item/target/pinned_target // the current pinned target
/obj/structure/target_stake/Destroy()
if(pinned_target)
qdel(pinned_target)
pinned_target = null
QDEL_NULL(pinned_target)
return ..()
/obj/structure/target_stake/Move()
@@ -34,9 +34,7 @@ obj/structure/windoor_assembly/New(dir=NORTH)
obj/structure/windoor_assembly/Destroy()
density = 0
if(electronics)
qdel(electronics)
electronics = null
QDEL_NULL(electronics)
air_update_turf(1)
return ..()