diff --git a/code/datums/components/magazine_catcher.dm b/code/datums/components/magazine_catcher.dm index c99c8565d2f..1deb0c9a02f 100644 --- a/code/datums/components/magazine_catcher.dm +++ b/code/datums/components/magazine_catcher.dm @@ -2,6 +2,8 @@ var/mob/living/carbon/human/wearer ///Parent storage in which we want to collect magazines var/obj/item/storage/storage + ////Auto catching empty magazines: FALSE - disabled, TRUE - enabled + var/auto_catch = TRUE /datum/component/magazine_catcher/Initialize() . = ..() @@ -18,9 +20,12 @@ RegisterSignal(parent, COMSIG_ITEM_EQUIPPED_TO_SLOT, PROC_REF(equipped_to_slot)) RegisterSignals(parent, list(COMSIG_ITEM_EQUIPPED_NOT_IN_SLOT, COMSIG_ITEM_DROPPED), PROC_REF(removed_from_slot)) storage = parent + storage.verbs += /datum/component/magazine_catcher/proc/toggle_auto_catch /datum/component/magazine_catcher/UnregisterFromParent() . = ..() + if(storage) + storage.verbs -= /datum/component/magazine_catcher/proc/toggle_auto_catch UnregisterSignal(parent, list(COMSIG_ITEM_EQUIPPED_TO_SLOT, COMSIG_ITEM_EQUIPPED_NOT_IN_SLOT, COMSIG_ITEM_DROPPED)) /datum/component/magazine_catcher/proc/equipped_to_slot(datum/source, mob/user, slot) @@ -43,4 +48,16 @@ /datum/component/magazine_catcher/proc/try_to_catch_magazine(datum/source, obj/item/mag) if(!storage.can_be_inserted(mag, FALSE)) return FALSE + if(!auto_catch) + return FALSE return storage.handle_item_insertion(mag, TRUE) + +/datum/component/magazine_catcher/proc/toggle_auto_catch() + set name = "Toggle Auto Catching Magazines/Speed Loaders" + set category = "Object" + var/datum/component/magazine_catcher/comp = GetComponent(/datum/component/magazine_catcher) + comp.auto_catch = !comp.auto_catch + if(!comp.auto_catch) + to_chat(usr, "Auto catching disabled.") + else + to_chat(usr, "Auto catching enabled.") diff --git a/code/game/objects/items/storage/holsters.dm b/code/game/objects/items/storage/holsters.dm index 30c99425162..643590db703 100644 --- a/code/game/objects/items/storage/holsters.dm +++ b/code/game/objects/items/storage/holsters.dm @@ -718,10 +718,13 @@ /obj/item/storage/holster/belt/revolver name = "generic revolver belt" desc = "A revolver belt that is not a pistol belt" + flags_equip_slot = ITEM_SLOT_BELT|ITEM_SLOT_SUITSTORE /obj/item/storage/holster/belt/revolver/Initialize(mapload, ...) . = ..() AddComponent(/datum/component/tac_reload_storage) + AddComponent(/datum/component/magazine_catcher) + AddComponent(/datum/component/easy_restock) /obj/item/storage/holster/belt/revolver/t457 name = "\improper T457 pattern revolver holster rig" diff --git a/code/modules/projectiles/guns/revolvers.dm b/code/modules/projectiles/guns/revolvers.dm index 715b5f705b9..1543e00d807 100644 --- a/code/modules/projectiles/guns/revolvers.dm +++ b/code/modules/projectiles/guns/revolvers.dm @@ -93,7 +93,8 @@ if(istype(new_magazine.loc, /obj/item/storage)) var/obj/item/storage/S = new_magazine.loc S.remove_from_storage(new_magazine, get_turf(user), user) - user.put_in_any_hand_if_possible(new_magazine) + if(!SEND_SIGNAL(user, COMSIG_MAGAZINE_DROP, new_magazine)) + user.put_in_any_hand_if_possible(new_magazine) reload(new_magazine, user) if(!do_after(user, tac_reload_time * 0.2, IGNORE_USER_LOC_CHANGE, new_magazine) && loc == user) return