Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. Azaril
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    Azaril

    @Azaril

    2
    Posts
    967
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Azaril Follow

    Posts made by Azaril

    • RE: getUsedCapacity fast-cache causes double counting of resources

      I had only reproduced it on a local private server - I have not tried on production.

      posted in Technical Issues and Bugs
      Azaril
    • 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:

      1. Fill a container with 900 resources.
      2. On a container, use container.store.getUsedCapacity(null)
      3. 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.

      posted in Technical Issues and Bugs
      Azaril