-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AI function fixes and improvements #440
Conversation
@@ -38,13 +38,12 @@ _position = [_position,_group] select (_position isEqualTo []); | |||
_position = _position call CBA_fnc_getPos; | |||
|
|||
[_group] call CBA_fnc_clearWaypoints; | |||
_group enableAttack false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reason behind this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's now using _unit disableAI "PATH";
this allows units not assigned to a position to counterattack in the case of contact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the commit message to more clearly reflect the reasoning
If a building search was enacted, the waypoint would be locked by the searchNearby function before it is actually considered completed. This would result in AI repeatedly going back to the same waypoint and triggering the onCompletion statement causing another building search.
The array of building positions stored by the function would be set to `nil` then subsequently set to an empty array in the event of all positions being used up. This would result in the building never being used again by future calls to the function.
- Minor optimization - Using the new `disableAI "PATH"` simplifies the code and allows it to be easily reverted unlike `doStop` - If patrol is enabled then units should patrol regardless of how many are assigned, otherwise they end up standing around - Units in position are told to stay upright for better use of windows and more engaging combat - No longer need to `enableAttack false` since no longer using `doStop` - which allows unassigned units to counterattack in case of contact
merge? |
When merged this pull request will: