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: inventories not saving locations properly when removing things #5839

Merged

Conversation

joveeater
Copy link
Collaborator

Required

Purpose of change

Fixes #5026

Describe the solution

The inventory now correctly stores the items current location and resets it to that rather than just using itself when it's removing things.

Testing

I managed to reproduce #5026 reliably. The random aspect is due to the call to x_in_y in item.cpp:10013. If you force that to true the bug will happen.

Additional context

I'm going to go through the code this afternoon and make sure there's nowhere else that I got it wrong like that.

@github-actions github-actions bot added the src changes related to source code. label Dec 27, 2024
Copy link
Contributor

autofix-ci bot commented Dec 27, 2024

Autofix has formatted code style violation in this PR.

I edit commits locally (e.g: git, github desktop) and want to keep autofix
  1. Run git pull. this will merge the automated commit into your local copy of the PR branch.
  2. Continue working.
I do not want the automated commit
  1. Format your code locally, then commit it.
  2. Run git push --force to force push your branch. This will overwrite the automated commit on remote with your local one.
  3. Continue working.

If you don't do this, your following commits will be based on the old commit, and cause MERGE CONFLICT.

@scarf005 scarf005 changed the title fix:Inventories not saving locations properly when removing things fix: inventories not saving locations properly when removing things Dec 27, 2024
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd be nice if we could encode safety requirements into items themselves...

@scarf005 scarf005 merged commit 0bb35ba into cataclysmbnteam:main Dec 27, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Having more than one UPS modded items throw errors
2 participants