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

Weight cache invalidation where needed #44661

Merged
merged 1 commit into from
Oct 7, 2020

Conversation

RoyBerube
Copy link
Contributor

Summary

SUMMARY: Bugfixes "Containers not updating weight in certain situations"

Purpose of change

Fixes #43328

This addresses a number of situations where weight is not updated because the cache is not invalidated.

  • Reload of a wielded tank that cannot be placed in inventory would not add any weight for the contents.

  • Unloading the same tank would not change the weight even if the starting weight was correct.

  • Unloading of a container on the map to one being wielded would not update the weight.

  • Loading of a wielded container from infinite source would not update the weight.

  • Wearing a backpack that cannot be placed in inventory from the map would not add the weight.

Describe the solution

Added cache invalidation to fix the situations above plus potentially others which use the same methods. Attempted to limit the invalidation to situations where weight would change such as loading with ammo from the map.

Describe alternatives you've considered

Testing

Tested the situations listed above.

Passed all unit tests.

There is a related problem with weapons loading magazines from the map not updating the weight. It is proving elusive to solve so will leave for another PR.

Additional context

@I-am-Erk I-am-Erk added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items: Containers Things that hold other things Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones labels Oct 7, 2020
@ZhilkinSerg ZhilkinSerg merged commit d4ab786 into CleverRaven:master Oct 7, 2020
@RoyBerube RoyBerube deleted the tank_weight branch October 8, 2020 03:11
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` Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones Items: Containers Things that hold other things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gathering water into wielded container do not change weight
3 participants