From 2b2f929a786d8418dd3bf6b4617c000d17ee5ae5 Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Wed, 6 Nov 2024 00:51:47 -0500 Subject: [PATCH] sigh --- code/__HELPERS/type_processing.dm | 7 ++++--- code/modules/mob/inventory/items.dm | 14 ++++++++------ code/modules/projectiles/gun.dm | 4 ++++ code/modules/projectiles/guns/gun_attachment.dm | 2 +- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/code/__HELPERS/type_processing.dm b/code/__HELPERS/type_processing.dm index 5ab1778c6eb..f2496f77efa 100644 --- a/code/__HELPERS/type_processing.dm +++ b/code/__HELPERS/type_processing.dm @@ -19,9 +19,10 @@ /obj/item/mecha_parts/mecha_equipment/weapon = "//mech_weapon", /obj/item/mecha_parts = "//mech_part", /obj/item/organ = "//organ", - /obj/item/gun/ballistic = "//ballistic", - /obj/item/gun/energy = "//energy", - /obj/item/gun/magnetic = "//magnetic", + /obj/item/gun_attachment = "//gun-attachment", + /obj/item/gun/ballistic = "//gun-ballistic", + /obj/item/gun/energy = "//gun-energy", + /obj/item/gun/magnetic = "//gun-magnetic", /obj/item/gun = "//gun", /obj/item/ammo_casing = "//ammo", /obj/item/ammo_magazine = "//magazine", diff --git a/code/modules/mob/inventory/items.dm b/code/modules/mob/inventory/items.dm index 167dab2680d..fd57ebf8138 100644 --- a/code/modules/mob/inventory/items.dm +++ b/code/modules/mob/inventory/items.dm @@ -123,9 +123,6 @@ if(!shieldcall.shields_in_inventory) continue user.unregister_shieldcall(shieldcall) - // fire signals - . = SEND_SIGNAL(src, COMSIG_ITEM_DROPPED, user, flags, newLoc) - SEND_SIGNAL(user, COMSIG_MOB_ITEM_DROPPED, src, flags, newLoc) //! LEGACY hud_unlayerise() @@ -136,6 +133,10 @@ zoom() //binoculars, scope, etc //! END + // fire signals + . = SEND_SIGNAL(src, COMSIG_ITEM_DROPPED, user, flags, newLoc) + SEND_SIGNAL(user, COMSIG_MOB_ITEM_DROPPED, src, flags, newLoc) + if((item_flags & ITEM_DROPDEL) && !(flags & INV_OP_DELETING)) qdel(src) . |= ITEM_RELOCATED_BY_DROPPED @@ -170,9 +171,6 @@ user.register_shieldcall(shieldcall) // storage stuff obj_storage?.on_pickup(user) - // fire signals - SEND_SIGNAL(src, COMSIG_ITEM_PICKUP, user, flags, oldLoc) - SEND_SIGNAL(user, COMSIG_MOB_ITEM_PICKUP, src, flags, oldLoc) //! LEGACY reset_pixel_offsets() @@ -183,6 +181,10 @@ playsound(src, pickup_sound, 20, ignore_walls = FALSE) //! END + // fire signals + SEND_SIGNAL(src, COMSIG_ITEM_PICKUP, user, flags, oldLoc) + SEND_SIGNAL(user, COMSIG_MOB_ITEM_PICKUP, src, flags, oldLoc) + /** * update our worn icon if we can */ diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 1f0a46aca06..db743ddf3ca 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -1072,6 +1072,10 @@ if(holding_mob) attachment.unregister_attachment_actions(holding_mob) attachment.on_detach(src) + // be extra extra extra EXTRA sure it doesn't still have an overlay + // todo: once we figure out why this is happening we should ASSERT() it to catch shitcode + if(attachment.gun_applied_overlay) + cut_overlay(attachment.gun_applied_overlay, TRUE) on_attachment_uninstall(attachment) attachment.attached = null LAZYREMOVE(attachments, attachment) diff --git a/code/modules/projectiles/guns/gun_attachment.dm b/code/modules/projectiles/guns/gun_attachment.dm index 8b0bb154537..bb2fec48601 100644 --- a/code/modules/projectiles/guns/gun_attachment.dm +++ b/code/modules/projectiles/guns/gun_attachment.dm @@ -61,7 +61,7 @@ var/gun_state /// the current applied overlay /// - /// * only the gun can modify this, and you shouldn't be using this for anything in a non-read-only + /// * only update_gun_overlay() can modify this, and you shouldn't be using this for anything in a non-read-only /// context. no, you are not special; there's no exceptions var/appearance/gun_applied_overlay