diff --git a/code/__HELPERS/qdel.dm b/code/__HELPERS/qdel.dm index 14b1f9d9594..e8a11f27a66 100644 --- a/code/__HELPERS/qdel.dm +++ b/code/__HELPERS/qdel.dm @@ -1,2 +1,2 @@ #define QDEL_IN(item, time) addtimer(GLOBAL_PROC, "qdel", time, FALSE, item) -#define QDEL_NULL(item) qdel(item); item = null \ No newline at end of file +#define QDEL_NULL(item) if(item) { qdel(item); item = null } \ No newline at end of file diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 881305948d7..ca312efc6a7 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -51,15 +51,13 @@ /obj/machinery/camera/Destroy() toggle_cam(null, 0) //kick anyone viewing out - if(assembly) - QDEL_NULL(assembly) + QDEL_NULL(assembly) if(istype(bug)) bug.bugged_cameras -= src.c_tag if(bug.current == src) bug.current = null bug = null - if(wires) - QDEL_NULL(wires) + QDEL_NULL(wires) cameranet.removeCamera(src) //Will handle removal from the camera network and the chunks, so we don't need to worry about that cameranet.cameras -= src var/area/ai_monitored/A = get_area(src) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index c75ca58140e..7921defd40f 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -112,8 +112,7 @@ buf.dna=new /obj/item/weapon/disk/data/Destroy() - if(buf) - QDEL_NULL(buf) + QDEL_NULL(buf) return ..() /obj/item/weapon/disk/data/demo diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm index e0a6e59da14..89baf450720 100644 --- a/code/game/objects/effects/anomalies.dm +++ b/code/game/objects/effects/anomalies.dm @@ -21,8 +21,7 @@ poi_list |= src /obj/effect/anomaly/Destroy() - if(aSignal) - QDEL_NULL(aSignal) + QDEL_NULL(aSignal) poi_list.Remove(src) return ..() diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 86ed5f84974..c10872afad0 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -27,8 +27,7 @@ SetValue(value) /obj/item/weapon/dnainjector/Destroy() - if(buf) - QDEL_NULL(buf) + QDEL_NULL(buf) return ..() /obj/item/weapon/dnainjector/proc/GetRealBlock(var/selblock) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index a3f038a507a..5d02d8a93f1 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -500,8 +500,7 @@ var/hasmob = 0 //If it contains a mob Destroy() - if(gas) - QDEL_NULL(gas) + QDEL_NULL(gas) active = 0 return ..()