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

Grenade pouch and tac vest causing absurd inventory display #53044

Closed
Terrorforge opened this issue Nov 26, 2021 · 5 comments · Fixed by #53079
Closed

Grenade pouch and tac vest causing absurd inventory display #53044

Terrorforge opened this issue Nov 26, 2021 · 5 comments · Fixed by #53079
Labels
<Bug> This needs to be fixed Good First Issue This is a good first issue for a new contributor Info / User Interface Game - player communication, menus, etc. Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones Items: Containers Things that hold other things

Comments

@Terrorforge
Copy link
Contributor

Describe the bug

Wearing the Tac Vest or Grenade Pouch causes the inventory "free volume" and "Volume (L)" values to display absurdly high values. Wearing both actually causes the Volume (L) maximum display to overflow and become negative.

This is presumably caused by #53009, in which is it likely applies to all wearable ammo-type containers.

Steps to reproduce

  1. Spawn Tac Vest and/or Grenade Pouch
  2. Wear
  3. Look at inventory

Expected behavior

The effectively infinite volume of ammo containers should not be include in the calculations for inventory volume.

Screenshots

image

Versions and configuration

  • OS: Windows
    • OS Version: 10.0 2009
  • Game Version: 04d1bce [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Bionic Professions [package_bionic_professions],
    Bionic Slots [cbm_slots],
    Extra Mutated Scenarios [extra_mut_scens],
    Military Profession Pack [military_professions]
    ]

Additional context

No response

@Hirmuolio
Copy link
Contributor

It is probably due to the odd pockets.

Pockets without defined size default to 2000000 liters (big default value so pocket without defined size will fit anything inside).

The grenade pouch has container pocket that takes only grenades. Since it accepts only grenades the volume doesn't matter so the pocket has no defined size. So it defaults to 2000000 liters.

Tac vest has one more of such pocket.

Since these are "just normal" container pockets they get added to the carry volume limit. And since the default 20000000 liters is already near the max integer (in ml) limit it rolls over.

The fix would be to set some sensible "max_contains_volume" to these pockets.
Maybe pockets that limit what items can be inserted in them should not count to total carry capacity? Technically their volume is kind of not real since they fit specific items without caring about the size of those specific items.

@catdach
Copy link
Contributor

catdach commented Nov 26, 2021

since the default 20000000 liters is already near the max integer (in ml) limit it rolls over.

It may be a good idea to reduce the default pocketsize by at least one order of magnitude. Probably unnecessary, especially for this specific issue, but it might be a good way to avoid any unforeseen problems with overflow.

@ZhilkinSerg
Copy link
Contributor

Pockets with specific item type filters probably should not contribute to free volume display at all.

@Terrorforge
Copy link
Contributor Author

Yeah, that's kind of a problem anyway. The volume display is often highly misleading because it's counting "free" space in holsters, scabbards and ammo pouches that can't actually be filled any further.

@wapcaplet wapcaplet added Info / User Interface Game - player communication, menus, etc. Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones Items: Containers Things that hold other things <Bug> This needs to be fixed labels Nov 27, 2021
@wapcaplet wapcaplet added the Good First Issue This is a good first issue for a new contributor label Nov 28, 2021
@bombasticSlacks
Copy link
Contributor

bombasticSlacks commented Nov 28, 2021

I ran up against this problem in #52745 originally I didn't want the pockets to interact with the max volume and free volume entries. It was easy to make a pocket with certain characteristics not be added to the displays (total_container_capacity) however the issue is the items in the pocket still have volume. So if you were only wearing an ammo pouch with 5 shells in it your display would show something like

Volume(L): .55/0 which is also undesirable. I guess you would have to track what items are stored in such pockets and also ignore their volume when calculating Character::free_space()

Or when calculating max volume, determine the exact volume of items in holsters and ammo in ammo items.

Alright I'm taking a crack at fixing this and also making some of the other issues with volume go away

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Good First Issue This is a good first issue for a new contributor Info / User Interface Game - player communication, menus, etc. Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones Items: Containers Things that hold other things
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants