From e68939646922e054220b46c08234d0436d0dec9b Mon Sep 17 00:00:00 2001 From: Drulikar Date: Mon, 15 Jan 2024 22:42:39 -0800 Subject: [PATCH] Fix Detach and on_detach parameter oversights --- code/modules/projectiles/gun_attachables.dm | 3 ++- code/modules/projectiles/gun_helpers.dm | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index 0f3fde8f3c9b..e431dbab4dab 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -168,7 +168,8 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/proc/Detach(mob/user, obj/item/weapon/gun/detaching_gub) if(!istype(detaching_gub)) return //Guns only - detaching_gub.on_detach(user) + if(user) + detaching_gub.on_detach(user, src) if(flags_attach_features & ATTACH_ACTIVATION) activate_attachment(detaching_gub, null, TRUE) diff --git a/code/modules/projectiles/gun_helpers.dm b/code/modules/projectiles/gun_helpers.dm index 8e73124a8b92..486e25315eef 100644 --- a/code/modules/projectiles/gun_helpers.dm +++ b/code/modules/projectiles/gun_helpers.dm @@ -395,7 +395,7 @@ DEFINES in setup.dm, referenced here. playsound(user, 'sound/handling/attachment_add.ogg', 15, 1, 4) return TRUE -/obj/item/weapon/gun/proc/on_detach(obj/item/attachable/attachment) +/obj/item/weapon/gun/proc/on_detach(mob/user, obj/item/attachable/attachment) return /obj/item/weapon/gun/proc/update_attachables() //Updates everything. You generally don't need to use this.