Skip to content

Commit

Permalink
Fixes strippers not working (#3649)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## 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:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Signed-off-by: Theos <[email protected]>
  • Loading branch information
SomeguyManperson authored Oct 31, 2024
1 parent ac5f7ae commit 4d92b54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions code/modules/projectiles/boxes_magazines/_box_magazine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/ballistic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
to_chat(user, "<span class='notice'>There's already a [magazine_wording] in \the [src].</span>")
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)
Expand Down

0 comments on commit 4d92b54

Please sign in to comment.