laverdet / xxscreeps

Other
71 stars 16 forks source link

[Bug] terminal.store.getUsedCapacity(RESOURCE_ENERGY) returns wrong value #20

Closed antonnyst closed 3 years ago

antonnyst commented 3 years ago

screenshot As seen in the image the terminal contains no energy and 70000 Z store.getUsedCapacity(RESOURCE_ENERGY) incorrectly returns 70000 instead of the expected 0 This behavior was seen on the xxworld.net server

antonnyst commented 3 years ago

Looking at the code the issue seems to be that OpenStore does not handle the optional parameter resource in the methods getCapacity and getUsedCapacity as described in https://docs.screeps.com/api/#Store

laverdet commented 3 years ago

56e2fe395fe049be4a650b7e3acd863e735e0c54 should have fixed this, thanks!