From 4d92b54e6fa05d6bf63f319acab9a2d20fd90358 Mon Sep 17 00:00:00 2001 From: Theos Date: Thu, 31 Oct 2024 05:01:08 -0400 Subject: [PATCH] Fixes strippers not working (#3649) ## About The Pull Request Fixes #3536 Fixes #3547 Ammo stacks added a check to prevent magazine to magazine filling which also prevented directly filling guns with anything that wasnt an ammo stack, which broke stripper clips and speedloaders. Revolvers escaped this since they handle everything related to loading completely differently. This moves the strict ammo stack check down a bit so ammo holders that are able to instantly transfer ammo between eachother can instead of dont ## Changelog :cl: fix: strippers and speedloaders for rifles now work again /:cl: --------- Signed-off-by: Theos --- code/modules/projectiles/boxes_magazines/_box_magazine.dm | 4 ++-- code/modules/projectiles/guns/ballistic.dm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/boxes_magazines/_box_magazine.dm b/code/modules/projectiles/boxes_magazines/_box_magazine.dm index 9c0003fd4b5d..9606536d9f66 100644 --- a/code/modules/projectiles/boxes_magazines/_box_magazine.dm +++ b/code/modules/projectiles/boxes_magazines/_box_magazine.dm @@ -123,10 +123,10 @@ if(!can_load(user)) return - if(istype(attacking_obj, /obj/item/ammo_box/magazine/ammo_stack)) + if(istype(attacking_obj, /obj/item/ammo_box)) var/obj/item/ammo_box/attacking_box = attacking_obj for(var/obj/item/ammo_casing/casing_to_insert in attacking_box.stored_ammo) - if(!((instant_load && attacking_box.instant_load) || (stored_ammo.len >= max_ammo) || do_after(user, 0.5 SECONDS, attacking_box, timed_action_flags = IGNORE_USER_LOC_CHANGE))) + if(!((instant_load && attacking_box.instant_load) || (stored_ammo.len >= max_ammo) || istype(attacking_obj, /obj/item/ammo_box/magazine/ammo_stack) && do_after(user, 0.5 SECONDS, attacking_box, timed_action_flags = IGNORE_USER_LOC_CHANGE))) break var/did_load = give_round(casing_to_insert, replace_spent) if(!did_load) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 6266b62cc7e4..debfc647e667 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -233,7 +233,7 @@ to_chat(user, "There's already a [magazine_wording] in \the [src].") return - if(istype(A, /obj/item/ammo_casing) || istype(A, /obj/item/ammo_box/magazine/ammo_stack)) + if(istype(A, /obj/item/ammo_casing) || istype(A, /obj/item/ammo_box)) if (bolt_type == BOLT_TYPE_NO_BOLT || internal_magazine) if (chambered && !chambered.BB) chambered.on_eject(shooter = user)