Closed zGeneral closed 5 years ago
I haven't bene able to reproduce the problem of incorrect road coverages. If you're getting incorrect road coverage calculations it seems as though something is incorrectly modifying this.colony.destinations
. We should try to identify what is actually causing the issue for you rather than slapping a band-aid on the problem. Can you create an issue with some more detailed data on what this.colony.destinations
is to try to identify the offending process?
looking closely at the code, this.colony.destinations
is being populated by the constructors of:
extract/harvest/upgradeSite.
I believe the issue happens when a harvest site is being claimed
there is no cleanup mechanism to remove it from destinations.
the newly claimed room will remain in destinations as if it is still a harvest site.
roads will not be built towards the claimed room. this will affect the roadCoverage percentage
Pull request summary
existing roadCoverage calculations takes into account all roadCoverages[] rooms which are being populated by directives. those rooms can be very far and many of them are not remote/SK rooms. by doing so, the road convergence % will mostly result in < 75%, which is the threshold for 2:1 transporter body. the fix will consider rooms in roadLookup instead (which include rm/sk/self-colony rooms only.
use the below in console to check existing roadCoverage: _.forEach(Memory.colonies,room =>{ console.log(room.roadPlanner.roadCoverage); })
Description:
Added:
Changed:
Removed:
Fixed:
Testing checklist:
tsconfig
configuration