Skip to content

Decide how reset should handle contents above the original capacity #27

Description

@user01010111

When an expanded storage or vehicle contains more than its original capacity, using Reset or Reset All restores the original capacity and immediately removes the excess contents.

This affects:

  • Per-fill-type storage
  • Shared-capacity storage
  • Husbandry food
  • Vehicle fill units

For shared storage and husbandry food, the reduction is spread proportionally across the stored fill types. The removed material is not transferred elsewhere and cannot be recovered.

Steps to reproduce

  1. Increase the capacity of a storage or vehicle.
  2. Fill it beyond its original capacity.
  3. Use Reset or Reset All.
  4. The capacity returns to its original value, and everything above that limit is removed.

Normal capacity changes are limited to the current fill level, which prevents this kind of loss. Reset follows a separate path: it applies the original capacity and then trims anything above it.

The current behavior appears to be deliberate. The reset code explicitly removes excess contents, and this was introduced in commit bd2ed00 (fix: remove excess fill when resetting capacity to original). It would be worth agreeing on the desired behavior before changing it.

The safest option may be to refuse the reset while the current contents exceed the original capacity and tell the player how much must be removed first. Other possibilities include:

  • Showing a clear confirmation with the amount that will be discarded
  • Keeping the current behavior but making the loss explicit in the interface and documentation
  • Temporarily retaining enough capacity for the existing contents until they fall below the original limit

Reset should either prevent accidental loss or make the loss clear before it happens.

Relevant functions in scripts/RmAdjustStorageCapacity.lua:

  • resetCapacity
  • resetVehicleCapacity
  • clampExcessFill
  • clampExcessHusbandryFood
  • clampExcessVehicleFill

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions