update IsPlattonDelay logic to work correctly in BuilderManager #5068
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the BuilderManager logic to handle the builder delay logic.
Updates the IsPlattonBuildDelayed to no longer update the brain table for the delay. This was causing any builder that passed through the builder manager to update.
It shifts the delay update to the builder return logic statement. This means that only the builder that is selected will be updated.
Testing
In order to validate this logic you will need to
add logs to line 299 that will tell you when a builder fails the delay check.
add logs to line 226 and 234 to log when the delay is added.
The delay is triggered when a builder gets triggered multiple times. The goal of the delay is to stop a situation where an engineer gets a job and starts moving to the builder location, then another engineer gets the same job before the first could start the construction. This trys to avoid situations where multiple builders or multiple instances of the builder will trigger because the conditions are right for the seconds it takes for the engineer to move to the build location.
in draft so I can quickly test this tonight.
As a side note. There are only 3 AI using this functionality at the moment(incase we want to consider fixing the typo in the name).