Skip to content

Fix for overhauling to storage buildings. #67

Open
simplyWiri wants to merge 1 commit intoMehni:masterfrom
simplyWiri:fix-overhauling
Open

Fix for overhauling to storage buildings. #67
simplyWiri wants to merge 1 commit intoMehni:masterfrom
simplyWiri:fix-overhauling

Conversation

@simplyWiri
Copy link
Contributor

Consider the situation where we have a storage building which accepts:

Meat x53
Corn x33
Rice x75

With the previous system, if we went to haul some Meat - to this storage cell - we would get the maximum capacity for the cell, as (75-53) + (75-33) = 64, and we would look for ~64 meat to haul. This is incorrect behavour, as we can only haul 22 meat to this storage item.

This gets worse when you consider cases where we have, for example:

2/3 slots filled
Meat x1
Corn x75
[empty]

In this case, if we query for meat - we have a capacity of ~149 - if we only have 74 meat, - then consider hauling some apparel (or any other item which stacks to one) - we will then attempt to haul 75 items of apparel to a single cell.

  • Fixes the bug described above
  • Makes the debug logging a bit more consistent by adding pawn name as a common prefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant