Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to reload ammo from location #14782

Merged
merged 4 commits into from Jan 11, 2016

Conversation

Projects
None yet
2 participants
@mugling
Copy link
Contributor

commented Jan 10, 2016

This is (hopefully) the final refactor of the reloading code before support for magazines can be added.

The two major changes are that items are now reloaded from an item_location rather than an inventory position and that the selection of ammo is changed from using character::items_with to character::visit_items as implemented in #14600.

The latter change is required so that differing logic can be implemented when reloading magazines (which always use loose ammo) vs guns (which may use magazines and/or loose ammo).

There are no intended behavioral changes in this PR however presuming there are no regressions a future PR may extend this to allow reloading using ammo found on the ground/vehicle or adjacent tiles.

mugling added some commits Jan 9, 2016

Refactor in item::pick_reload_ammo
Drop usage of items_with and replace with visit_items in preparation
for the later addition of magazines

@kevingranade kevingranade merged commit 304c438 into CleverRaven:master Jan 11, 2016

1 check passed

default
Details

@mugling mugling deleted the mugling:mags_p12 branch Jan 31, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.