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

Make unloading items not pick them up #40541

Merged
merged 3 commits into from
May 16, 2020

Conversation

floyza
Copy link
Contributor

@floyza floyza commented May 13, 2020

Summary

SUMMARY: Interface "Make unloading items not pick them up"

Purpose of change

Fixes #40000

Describe the solution

Make player::unload take a item_location& instead of an item&. It used to assume that the item was in the in the player's inventory, constructing a item_location using *this. #37023 was a workaround for this, picking up any item before unloading it. I kept the check for deleting an item with MAG_DESTROY that is not a magazine, but moved it from avatar_action::unload into player::unload.

Describe alternatives you've considered

Maybe move the deleting of empty belts to outside of player::unload?

Testing

Placed ammo belts and regular items on the floor, and unloaded them. Also added MAG_DESTROY flag to talking doll and unloaded it from the floor, as magazines are handled differently than other things with ammo.

src/player.cpp Outdated Show resolved Hide resolved
Refactor everything to use the new function
@curstwist curstwist added [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. labels May 15, 2020
@kevingranade kevingranade merged commit 339ff0c into CleverRaven:master May 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unloading items should not pick them up
4 participants