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

fix unload visitable error #37023

Merged
merged 1 commit into from
Jan 14, 2020

Conversation

KorGgenT
Copy link
Member

Summary

SUMMARY: Bugfixes "Fix unloading ammo belts on map"

Purpose of change

Fixes #35368

Describe the solution

When pressing U it brings up a menu to allow you to unload items from your inventory and from the map. the unload function itself assumes that the items are in your inventory, and constructs an item_location from the player object. This leads to an error with the visitable interface, since the item isn't owned by what it thinks it is. A more thorough fix is to refactor the whole unload funciton into 3 or more functions that do separate things, since at least one of the things the current unload function does is to open a prompt.

The actual fix is to call item_location::obtain() in avatar_action::unload() which is the function that opens the inventory prompt and allows you to pick items that are not in your inventory.

Testing

spawn an ammo belt, drop it next to me, and then press U to unload it.

@KorGgenT KorGgenT added Items / Item Actions / Item Qualities Items and how they work and interact <Bugfix> This is a fix for a bug (or closes open issue) labels Jan 13, 2020
@ZhilkinSerg ZhilkinSerg merged commit 66408c2 into CleverRaven:master Jan 14, 2020
@KorGgenT KorGgenT deleted the fix-unload-visitable-error branch August 13, 2020 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) Items / Item Actions / Item Qualities Items and how they work and interact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unloading adjacent ammo belts throws error, leaves empty belt behind
2 participants