Fix : Remove unused personality calls in default skirmish AI code #6602
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.
Description of the proposed changes
This PR removed unused code from the Skirmish AI factory and platoon former manager.
The personality function calls were present in both the factory manager and platoonformer manager.
In the factory manager they created a ptnsize variable that is unused.
In the platoonformer manager that are used twice in CanFormPlatoon and FormPlatoon as the platoon count parameter. I validated that in the default AI this is always returning 1. So I've removed the function calls and replaced with a static integer of 1.
Testing done on the proposed changes
Tested that this change has no bearing on the AI functionality, nor does it cause a desync when comparing an replay with and without the changes indicating it is doing nothing out of what has already been analyzed.
Additional context
The functions that are being modified are used by the AI multiple times per second so while removing the function calls may not seem like much it is saving some compute and memory.
Checklist