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

Fixed "Wielding MBR vest with magazines allow to duplicate magazines #33189" #33422

Merged
merged 1 commit into from
Aug 21, 2019

Conversation

ipcyborg
Copy link
Contributor

Summary

SUMMARY: Content "Wielding MBR vest with magazines allow to duplicate magazines #33189"

Purpose of change

Fixes #33189

Describe the solution

The code in pick_one_up makes a copy of original item to revert the changes in case of cancellation.
But at least two places there require the original item reference, not a copy:

  • wear item (in case of drawing from holster)
  • spill liquid (was already fixed)

Fixed by using original item reference there.
Added comments to specify the usage of original item.

Describe alternatives you've considered

There could be more places that require original item instead of a copy.
Tried to use different logic: do not make a copy and use original item in pick_one_up.
Looks like better but complicated solution.

Additional context

None

@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact Items: Magazines Ammo holding items and objects. labels Aug 21, 2019
@ZhilkinSerg ZhilkinSerg merged commit 21928e3 into CleverRaven:master Aug 21, 2019
@ipcyborg ipcyborg deleted the fix-33189-pickup-duplicate branch August 21, 2019 09:12
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) [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact Items: Magazines Ammo holding items and objects.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wielding MBR vest with magazines allow to duplicate magazines
2 participants