From 1c996491dd0f69b916c7649c5d32ef45e18054fc Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 17 Jun 2017 09:27:56 +0100 Subject: [PATCH] Removes more unnecessary code And revert of something that is just adding an unnecessary check by doing the QDEL_NULL --- code/game/machinery/cryopod.dm | 3 +-- .../clothing/spacesuits/rig/modules/computer.dm | 7 ++----- code/modules/hydroponics/hydroponics.dm | 6 +++--- code/modules/mob/living/silicon/robot/robot.dm | 11 +++++------ 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 13d1d7505de..0478141abe3 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -316,8 +316,7 @@ if(istype(W,/obj/item/device/pda)) var/obj/item/device/pda/P = W - if(P.id) - QDEL_NULL(P.id) + QDEL_NULL(P.id) qdel(P) if(!preserve) diff --git a/code/modules/clothing/spacesuits/rig/modules/computer.dm b/code/modules/clothing/spacesuits/rig/modules/computer.dm index fed2dbce22a..32908822fee 100644 --- a/code/modules/clothing/spacesuits/rig/modules/computer.dm +++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm @@ -163,11 +163,8 @@ to_chat(user, "You cannot eject your currently stored AI. Purge it manually.") return 0 to_chat(user, "You purge the remaining scraps of data from your previous AI, freeing it for use.") - if(integrated_ai) - integrated_ai.ghostize() - QDEL_NULL(integrated_ai) - if(ai_card) - QDEL_NULL(ai_card) + QDEL_NULL(integrated_ai) + QDEL_NULL(ai_card) else if(user) user.put_in_hands(ai_card) else diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index d38a7468d9c..a72dac932c0 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -442,8 +442,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_NULL(myseed) + 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 @@ -911,7 +910,8 @@ plant_health = 0 if(harvest) harvest = FALSE //To make sure they can't just put in another seed and insta-harvest it - QDEL_NULL(myseed) + qdel(myseed) + myseed = null plant_hud_set_health() plant_hud_set_status() adjustWeeds(-10) //Has a side effect of cleaning up those nasty weeds diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 88e1f30c13f..3de8b868430 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1205,12 +1205,11 @@ var/list/robot_verbs_default = list( canmove = 1 scrambledcodes = 1 //Disconnect it's camera so it's not so easily tracked. - if(src.camera) - 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. - // I could change the network to null but I don't know what would happen, and it seems too hacky for me. + 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. + // I could change the network to null but I don't know what would happen, and it seems too hacky for me. /mob/living/silicon/robot/proc/ResetSecurityCodes() set category = "Robot Commands"