I had only reproduced it on a local private server - I have not tried on production.
Azaril
@Azaril
2
Posts
732
Profile views
0
Followers
0
Following
Posts made by Azaril
-
RE: getUsedCapacity fast-cache causes double counting of resources
-
getUsedCapacity fast-cache causes double counting of resources
I spent a few hours today tracking down why transfering with a specific amount was failing and I was able to isolate it to the fast cache that exists for Store.getUsedCapacity. It appears that after using the function in a tick, resources will then be double counted on the store object in a number of cases.
It looks like this may have been modified on PTR: https://github.com/screeps/engine/commit/9f00e3bdee4dfdb910e985ba1be78b58b1e7bd31
Repro steps:
- Fill a container with 900 resources.
- On a container, use container.store.getUsedCapacity(null)
- Attempt to transfer 300 resources to the container.
Expected: Transfer from creep to container returns a success error code.
Actual: It will fail with ERR_FULL as utils.calcResources returns 1800 resources in the container instead of 900.