Uses more QDEL_NULLs

This commit is contained in:
Sam
2017-06-15 00:49:00 +01:00
parent 5131f91725
commit d0dde4f3d7
34 changed files with 65 additions and 118 deletions
+2 -4
View File
@@ -376,10 +376,8 @@
return 1
/datum/click_intercept/buildmode/proc/deselect_region()
qdel(cornerA)
cornerA = null
qdel(cornerB)
cornerB = null
QDEL_NULL(cornerA)
QDEL_NULL(cornerB)
/datum/click_intercept/buildmode/proc/Reset()//Reset temporary variables
deselect_region()
@@ -165,11 +165,9 @@
to_chat(user, "<span class='danger'>You purge the remaining scraps of data from your previous AI, freeing it for use.</span>")
if(integrated_ai)
integrated_ai.ghostize()
qdel(integrated_ai)
integrated_ai = null
QDEL_NULL(integrated_ai)
if(ai_card)
qdel(ai_card)
ai_card = null
QDEL_NULL(ai_card)
else if(user)
user.put_in_hands(ai_card)
else
@@ -287,8 +287,7 @@
flick("bottler_on", src)
spawn(45)
for(var/i = 1, i <= slots.len, i++)
qdel(slots[i])
slots[i] = null
QDEL_NULL(slots[i])
bottling = 0
drink_container.forceMove(loc)
updateUsrDialog()
@@ -406,4 +405,4 @@
else if(bottling)
icon_state = "bottler_on"
else
icon_state = "bottler_off"
icon_state = "bottler_off"
+2 -3
View File
@@ -296,8 +296,7 @@
var/datum/plant_gene/core/gene = disk.gene
gene.value = min(gene.value, max_extract_pot)
disk.update_name()
qdel(seed)
seed = null
QDEL_NULL(seed)
update_icon()
if("replace")
if(disk && disk.gene && istype(disk.gene, G.type) && istype(G, /datum/plant_gene/core))
@@ -421,4 +420,4 @@
/obj/item/weapon/storage/box/disks_plantgene/New()
..()
for(var/i in 1 to 7)
new /obj/item/weapon/disk/plantgene(src)
new /obj/item/weapon/disk/plantgene(src)
+7 -13
View File
@@ -373,8 +373,7 @@
var/oldPlantName
if(myseed) // In case there's nothing in the tray beforehand
oldPlantName = myseed.plantname
qdel(myseed)
myseed = null
QDEL_NULL(myseed)
else
oldPlantName = "empty tray"
switch(rand(1,18)) // randomly pick predominative weed
@@ -422,8 +421,7 @@
var/oldPlantName = myseed.plantname
if(myseed.mutatelist.len > 0)
var/mutantseed = pick(myseed.mutatelist)
qdel(myseed)
myseed = null
QDEL_NULL(myseed)
myseed = new mutantseed
else
return
@@ -445,8 +443,7 @@
/obj/machinery/hydroponics/proc/mutateweed() // If the weeds gets the mutagent instead. Mind you, this pretty much destroys the old plant
if( weedlevel > 5 )
if(myseed)
qdel(myseed)
myseed = null
QDEL_NULL(myseed)
var/newWeed = pick(/obj/item/seeds/liberty, /obj/item/seeds/angel, /obj/item/seeds/nettle/death, /obj/item/seeds/kudzu)
myseed = new newWeed
dead = 0
@@ -914,8 +911,7 @@
plant_health = 0
if(harvest)
harvest = FALSE //To make sure they can't just put in another seed and insta-harvest it
qdel(myseed)
myseed = null
QDEL_NULL(myseed)
plant_hud_set_health()
plant_hud_set_status()
adjustWeeds(-10) //Has a side effect of cleaning up those nasty weeds
@@ -935,8 +931,7 @@
else if(dead)
dead = 0
to_chat(user, "<span class='notice'>You remove the dead plant from [src].</span>")
qdel(myseed)
myseed = null
QDEL_NULL(myseed)
update_icon()
plant_hud_set_status()
plant_hud_set_health()
@@ -953,8 +948,7 @@
else
to_chat(user, "<span class='notice'>You harvest [myseed.getYield()] items from the [myseed.plantname].</span>")
if(!myseed.get_gene(/datum/plant_gene/trait/repeated_harvest))
qdel(myseed)
myseed = null
QDEL_NULL(myseed)
dead = 0
plant_hud_set_status()
plant_hud_set_health()
@@ -1041,4 +1035,4 @@
else
..()
#undef HYDRO_CYCLES_PER_AGE
#undef HYDRO_CYCLES_PER_AGE
+1 -2
View File
@@ -178,8 +178,7 @@
M = new manual_type()
dat += "<tr><td><A href='?src=[UID()];manual=[manualcount]'>[M.title]</A></td></tr>"
manualcount++
qdel(M)
M = null
QDEL_NULL(M)
dat += "</table>"
dat += "<BR><A href='?src=[UID()];switchscreen=0'>(Return to main menu)</A><BR>"
+1 -2
View File
@@ -1040,8 +1040,7 @@
mark = 0
if(L.mob_size >= MOB_SIZE_LARGE)
L.underlays -= marked_image
qdel(marked_image)
marked_image = null
QDEL_NULL(marked_image)
var/backstab = check_target_facings(user, L)
var/def_check = L.getarmor(type = "bomb")
if(backstab == FACING_INIT_FACING_TARGET_TARGET_FACING_PERPENDICULAR || backstab == FACING_SAME_DIR)
@@ -1206,8 +1206,7 @@ var/list/robot_verbs_default = list(
scrambledcodes = 1
//Disconnect it's camera so it's not so easily tracked.
if(src.camera)
qdel(src.camera)
src.camera = null
QDEL_NULL(src.camera)
// I'm trying to get the Cyborg to not be listed in the camera list
// Instead of being listed as "deactivated". The downside is that I'm going
// to have to check if every camera is null or not before doing anything, to prevent runtime errors.
@@ -167,9 +167,8 @@
mode = BOT_CLEANING
spawn(50)
if(mode == BOT_CLEANING)
qdel(target)
QDEL_NULL(target)
anchored = 0
target = null
mode = BOT_IDLE
icon_state = "cleanbot[on]"
@@ -222,4 +221,4 @@ text("<A href='?src=[UID()];power=1'>[on ? "On" : "Off"]</A>"))
if(istype(A,/obj/effect/decal/cleanable))
clean(A)
else
..()
..()
@@ -213,8 +213,7 @@
if("PRG_deletechannel")
. = 1
if(channel && ((channel.operator == src) || netadmin_mode))
qdel(channel)
channel = null
QDEL_NULL(channel)
if("PRG_setpassword")
. = 1
if(!channel || ((channel.operator != src) && !netadmin_mode))
@@ -228,4 +227,4 @@
if(newpassword == "nopassword")
channel.password = ""
else
channel.password = newpassword
channel.password = newpassword
@@ -32,11 +32,9 @@
state = 0
devtype = 0
if(fabricated_laptop)
qdel(fabricated_laptop)
fabricated_laptop = null
QDEL_NULL(fabricated_laptop)
if(fabricated_tablet)
qdel(fabricated_tablet)
fabricated_tablet = null
QDEL_NULL(fabricated_tablet)
dev_cpu = 1
dev_battery = 1
dev_disk = 1
@@ -303,4 +301,4 @@ obj/machinery/lapvend/attackby(obj/item/I, mob/user)
T.time = worldtime2text()
vendor_account.transaction_log.Add(T)
return 1
return 0
return 0
@@ -29,8 +29,7 @@
sleep(10)
to_chat(usr, "<span style='color: #0000ff;'>Disconnecting neural-net interface...</span> <span style='color: #32CD32'><b>Success</b>.</span>")
if(usr.hud_used)
qdel(usr.hud_used)
usr.hud_used = null
QDEL_NULL(usr.hud_used)
usr.create_mob_hud()
usr.regenerate_icons()
@@ -65,8 +64,7 @@
sleep(5)
to_chat(usr, "<span style='color: #0000ff;'>Suit secured, extending neural-net interface...</span>")
if(usr.hud_used)
qdel(usr.hud_used)
usr.hud_used = null
QDEL_NULL(usr.hud_used)
usr.hud_used = new /datum/hud/human(usr, 'icons/mob/screen_ninja.dmi', "#ffffff", 255)
if(usr.hud_used)
usr.hud_used.show_hud(usr.hud_used.hud_version)
@@ -91,4 +89,4 @@
to_chat(usr, "<span style='color: #0000ff;'><b>NOTICE: </b>Suit de-activation protocals aborted.</span>")
else
to_chat(usr, "<span style='color: #ff0000;'><b>FĆAL RrR</b>: ŧer nt recgnized, c-cntr-r䣧-ç äcked.")
return
return
+1 -2
View File
@@ -43,8 +43,7 @@
if(targloc == curloc)
if(target) //if the target is right on our location we go straight to bullet_act()
target.bullet_act(BB, BB.def_zone)
qdel(BB)
BB = null
QDEL_NULL(BB)
return 1
BB.preparePixelProjectile(target, targloc, user, params, spread)
+1 -2
View File
@@ -377,8 +377,7 @@
user.visible_message(user, "<span class='warning'>[user] is drilling through the [src]'s lock!</span>",
"<span class='notice'>You start drilling through the [src]'s lock!</span>")
if(do_after(user, 100 * W.toolspeed, target = src))
qdel(equipment_system.lock_system)
equipment_system.lock_system = null
QDEL_NULL(equipment_system.lock_system)
user.visible_message(user, "<span class='warning'>[user] has destroyed the [src]'s lock!</span>",
"<span class='notice'>You destroy the [src]'s lock!</span>")
else