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

Set owner of disassembly result #75411

Merged
merged 1 commit into from
Aug 4, 2024

Conversation

inogenous
Copy link
Contributor

Summary

Bugfixes "Set owner of disassembly result"

Purpose of change

Sets the owner for items produced by disassembly to the character performing the disassembly.

Describe the solution

Prevents the following situation that could happen before:

  1. Have an auto-pickup rule for "m:gold", and config option "Auto pickup owned items"=false, so that everything gold is picked up unless it's already yours.
  2. Disassemble some gold item, for example "gold watch"
  3. Disassembly results are placed somewhere adjacent, including some gold.
  4. Move one step, which triggers autopickup
  5. Auto-pickup rule from step 1 triggers, and picks up the gold from step 3

This commit instead makes it so that step 5 will not auto-pickup the disassembled gold. Instead, it will stay put just like if you had dropped it there.

Describe alternatives you've considered

Could have instead used act_item.set_owner( dis_item.get_owner() ) , but that's slightly longer and not as explicit.

Testing

Performed the steps above. The disassembled gold is no longer auto-picked up.

Additional context

@github-actions github-actions bot added Crafting / Construction / Recipes Includes: Uncrafting / Disassembling [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Aug 3, 2024
Sets the owner for items produced by disassembly to the character
performing the disassembly.

Prevents the following situation that could happen before:
1. Have an auto-pickup rule for "m:gold", and config option "Auto pickup
   owned items"=false, so that everything gold is picked up unless it's
   already yours.
2. Disassemble some gold item, for example "gold watch"
3. Disassembly results are placed somewhere adjacent, including some
   gold.
4. Move one step, which triggers autopickup
5. Auto-pickup rule from step 1 triggers, and picks up the gold from
   step 3

This commit instead makes it so that step 5 will not auto-pickup the
disassembled gold. Instead, it will stay put just like if you had
dropped it there.
@inogenous inogenous force-pushed the owner-of-disassembly branch from d37a0ec to 1591eb0 Compare August 3, 2024 08:14
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 3, 2024
@dseguin dseguin merged commit b752cd7 into CleverRaven:master Aug 4, 2024
21 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Crafting / Construction / Recipes Includes: Uncrafting / Disassembling json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants