diff --git a/code/datums/action.dm b/code/datums/action.dm
index 9bc58c399dd46..8151f5a4103cd 100644
--- a/code/datums/action.dm
+++ b/code/datums/action.dm
@@ -366,16 +366,13 @@
/datum/action/item_action/nano_picket_sign
name = "Retext Nano Picket Sign"
- var/obj/item/picket_sign/S
-
-/datum/action/item_action/nano_picket_sign/New(Target)
- ..()
- if(istype(Target, /obj/item/picket_sign))
- S = Target
/datum/action/item_action/nano_picket_sign/Trigger()
- if(istype(S))
- S.retext(owner)
+ if(!istype(target, /obj/item/picket_sign))
+ return
+
+ var/obj/item/picket_sign/sign = target
+ sign.retext(owner)
/datum/action/item_action/adjust
diff --git a/code/datums/components/remote_materials.dm b/code/datums/components/remote_materials.dm
index 2f3aa79749b24..16c695fe9c066 100644
--- a/code/datums/components/remote_materials.dm
+++ b/code/datums/components/remote_materials.dm
@@ -39,6 +39,7 @@ handles linking back and forth.
// specify explicitly in case the other component is deleted first
var/atom/P = parent
mat_container.retrieve_all(P.drop_location())
+ mat_container = null
return ..()
/datum/component/remote_materials/proc/_MakeLocal()
@@ -77,9 +78,11 @@ handles linking back and forth.
/datum/component/remote_materials/proc/OnAttackBy(datum/source, obj/item/I, mob/user)
SIGNAL_HANDLER
- if (silo && istype(I, /obj/item/stack))
- if (silo.remote_attackby(parent, user, I))
- return COMPONENT_NO_AFTERATTACK
+ if (!silo || !istype(I, /obj/item/stack))
+ return
+
+ if (silo.remote_attackby(parent, user, I))
+ return COMPONENT_NO_AFTERATTACK
/datum/component/remote_materials/proc/OnMultitool(datum/source, mob/user, obj/item/I)
SIGNAL_HANDLER
diff --git a/code/game/objects/items/implants/implant_misc.dm b/code/game/objects/items/implants/implant_misc.dm
index c4c832209baca..d8f871e1ecc42 100644
--- a/code/game/objects/items/implants/implant_misc.dm
+++ b/code/game/objects/items/implants/implant_misc.dm
@@ -110,6 +110,10 @@
radio.keyslot = new radio_key
radio.recalculateChannels()
+/obj/item/implant/radio/Destroy()
+ QDEL_NULL(radio)
+ return ..()
+
/obj/item/implant/radio/mining
radio_key = /obj/item/encryptionkey
diff --git a/code/game/turfs/closed/minerals.dm b/code/game/turfs/closed/minerals.dm
index 3970cc403d73b..7b007bb98472b 100644
--- a/code/game/turfs/closed/minerals.dm
+++ b/code/game/turfs/closed/minerals.dm
@@ -167,7 +167,6 @@
ScrapeAway()
/turf/closed/mineral/ex_act(severity, target)
- ..()
switch(severity)
if(3)
if (prob(75))
@@ -177,7 +176,7 @@
gets_drilled(null, FALSE)
if(1)
gets_drilled(null, FALSE)
- return
+ return ..()
/turf/closed/mineral/random
var/list/mineralSpawnChanceList = list(/obj/item/stack/ore/uranium = 3, /obj/item/stack/ore/diamond = 1, /obj/item/stack/ore/gold = 4,
diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm
index 236c7b040d992..a95e153c0e140 100644
--- a/code/modules/atmospherics/machinery/airalarm.dm
+++ b/code/modules/atmospherics/machinery/airalarm.dm
@@ -239,8 +239,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/airalarm, 27)
/obj/machinery/airalarm/Destroy()
SSradio.remove_object(src, frequency)
- qdel(wires)
- wires = null
+ QDEL_NULL(wires)
var/area/ourarea = get_area(src)
ourarea.atmosalert(FALSE, src)
return ..()
diff --git a/code/modules/clothing/under/accessories.dm b/code/modules/clothing/under/accessories.dm
index 0d05c4e0cf7fb..89cce9c24d644 100644
--- a/code/modules/clothing/under/accessories.dm
+++ b/code/modules/clothing/under/accessories.dm
@@ -444,6 +444,10 @@
chameleon_action.chameleon_name = "Accessory"
chameleon_action.initialize_disguises()
+/obj/item/clothing/accessory/holster/chameleon/Destroy()
+ QDEL_NULL(chameleon_action)
+ return ..()
+
/obj/item/clothing/accessory/holster/chameleon/emp_act(severity)
. = ..()
if(. & EMP_PROTECT_SELF)
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm
index ee48ed624ee47..e7257c7d39c40 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/gutlunch.dm
@@ -43,12 +43,16 @@
animal_species = /mob/living/simple_animal/hostile/asteroid/gutlunch
childtype = list(/mob/living/simple_animal/hostile/asteroid/gutlunch/grublunch = 100)
+ var/mutable_appearance/gutlunch_full_overlay
+
wanted_objects = list(/obj/effect/decal/cleanable/xenoblood/xgibs, /obj/effect/decal/cleanable/blood/gibs/, /obj/item/organ, /obj/item/reagent_containers/food/snacks/meat/slab)
/mob/living/simple_animal/hostile/asteroid/gutlunch/Initialize()
. = ..()
- if(wanted_objects.len)
- AddComponent(/datum/component/udder, /obj/item/udder/gutlunch, CALLBACK(src, PROC_REF(regenerate_icons)), CALLBACK(src, PROC_REF(regenerate_icons)))
+ if(!length(wanted_objects))
+ return
+ AddComponent(/datum/component/udder, /obj/item/udder/gutlunch, CALLBACK(src, TYPE_PROC_REF(/atom/movable, update_overlays)), CALLBACK(src, TYPE_PROC_REF(/atom/movable, update_overlays)))
+ gutlunch_full_overlay = mutable_appearance(icon, "gl_full")
/mob/living/simple_animal/hostile/asteroid/gutlunch/CanAttack(atom/the_target) // Gutlunch-specific version of CanAttack to handle stupid stat_exclusive = true crap so we don't have to do it for literally every single simple_animal/hostile except the two that spawn in lavaland
if(isturf(the_target) || !the_target || the_target.type == /atom/movable/lighting_object) // bail out on invalids
@@ -72,14 +76,12 @@
return FALSE
-/mob/living/simple_animal/hostile/asteroid/gutlunch/regenerate_icons(new_udder_volume, max_udder_volume)
- cut_overlays()
- var/static/gutlunch_full_overlay
- if(isnull(gutlunch_full_overlay))
- gutlunch_full_overlay = iconstate2appearance(icon, "gl_full")
- if(new_udder_volume == max_udder_volume)
- add_overlay(gutlunch_full_overlay)
- ..()
+/mob/living/simple_animal/hostile/asteroid/gutlunch/update_overlays(new_udder_volume, max_udder_volume)
+ . = ..()
+ if(new_udder_volume != max_udder_volume)
+ return
+
+ . += gutlunch_full_overlay
//Male gutlunch. They're smaller and more colorful!
/mob/living/simple_animal/hostile/asteroid/gutlunch/gubbuck
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index 73920780bef39..a6cd227550ec8 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -119,6 +119,7 @@
log_game("Emitter deleted at [AREACOORD(T)]")
investigate_log("deleted at [AREACOORD(T)]", INVESTIGATE_SINGULO)
QDEL_NULL(sparks)
+ QDEL_NULL(wires)
return ..()
/obj/machinery/power/emitter/update_icon_state()
diff --git a/code/modules/projectiles/boxes_magazines/_box_magazine.dm b/code/modules/projectiles/boxes_magazines/_box_magazine.dm
index 57fb71d17f324..73a626721f4bf 100644
--- a/code/modules/projectiles/boxes_magazines/_box_magazine.dm
+++ b/code/modules/projectiles/boxes_magazines/_box_magazine.dm
@@ -73,6 +73,10 @@
for(var/i = max(1, stored_ammo.len), i <= max_ammo, i++)
stored_ammo += new round_check(src)
+/obj/item/ammo_box/Destroy()
+ stored_ammo.Cut()
+ return ..()
+
///gets a round from the magazine, if keep is TRUE the round will stay in the gun
/obj/item/ammo_box/proc/get_round(keep = FALSE)
if(!stored_ammo.len)
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index f848018a61157..ae6131981fd90 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -262,8 +262,6 @@
*/
///The types of attachments allowed, a list of types. SUBTYPES OF AN ALLOWED TYPE ARE ALSO ALLOWED
var/list/valid_attachments = list()
- ///Reference to our attachment holder to prevent subtypes having to call GetComponent
- var/datum/component/attachment_holder/attachment_holder
///Number of attachments that can fit on a given slot
var/list/slot_available = ATTACHMENT_DEFAULT_SLOT_AVAILABLE
///Offsets for the slots on this gun. should be indexed by SLOT and then by X/Y
@@ -339,7 +337,7 @@
/obj/item/gun/ComponentInitialize()
. = ..()
- attachment_holder = AddComponent(/datum/component/attachment_holder, slot_available, valid_attachments, slot_offsets, default_attachments)
+ AddComponent(/datum/component/attachment_holder, slot_available, valid_attachments, slot_offsets, default_attachments)
AddComponent(/datum/component/two_handed)
/// triggered on wield of two handed item
@@ -384,6 +382,8 @@
QDEL_NULL(azoom)
if(muzzle_flash)
QDEL_NULL(muzzle_flash)
+ if(magazine)
+ QDEL_NULL(magazine)
return ..()
/obj/item/gun/handle_atom_del(atom/A)
@@ -1008,18 +1008,21 @@
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_HANDS_BLOCKED|AB_CHECK_IMMOBILE|AB_CHECK_LYING
icon_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "sniper_zoom"
- var/obj/item/gun/gun = null
/datum/action/toggle_scope_zoom/Trigger()
+ if(!istype(target, /obj/item/gun) || !..())
+ return
+
+ var/obj/item/gun/gun = target
gun.zoom(owner, owner.dir)
-/datum/action/toggle_scope_zoom/IsAvailable()
- . = ..()
- if(!. && gun)
- gun.zoom(owner, owner.dir, FALSE)
+/datum/action/toggle_scope_zoom/Remove(mob/user)
+ if(!istype(target, /obj/item/gun))
+ return ..()
+
+ var/obj/item/gun/gun = target
+ gun.zoom(user, user.dir, FALSE)
-/datum/action/toggle_scope_zoom/Remove(mob/living/L)
- gun.zoom(L, L.dir, FALSE)
..()
/obj/item/gun/proc/rotate(atom/thing, old_dir, new_dir)
@@ -1056,8 +1059,7 @@
return
if(zoomable)
- azoom = new()
- azoom.gun = src
+ azoom = new(src)
/obj/item/gun/proc/build_firemodes()
if(FIREMODE_FULLAUTO in gun_firemodes)
diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm
index b86c5b8b86ce1..3ec636e41b5fe 100644
--- a/code/modules/surgery/organs/vocal_cords.dm
+++ b/code/modules/surgery/organs/vocal_cords.dm
@@ -35,13 +35,13 @@
/datum/action/item_action/organ_action/colossus
name = "Voice of God"
- var/obj/item/organ/vocal_cords/colossus/cords = null
-
-/datum/action/item_action/organ_action/colossus/New()
- ..()
- cords = target
/datum/action/item_action/organ_action/colossus/IsAvailable()
+ if(!istype(target, /obj/item/organ/vocal_cords/colossus))
+ return FALSE
+
+ var/obj/item/organ/vocal_cords/colossus/cords = target
+
if(world.time < cords.next_command)
return FALSE
if(!owner)
@@ -58,6 +58,7 @@
/datum/action/item_action/organ_action/colossus/Trigger()
. = ..()
if(!IsAvailable())
+ var/obj/item/organ/vocal_cords/colossus/cords = target
if(world.time < cords.next_command)
to_chat(owner, "You must wait [DisplayTimeText(cords.next_command - world.time)] before Speaking again.")
return