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