Skip to content
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: Don't halt planned movement for empty group #1274

Merged
merged 3 commits into from
Jan 17, 2020
Merged

AI: Don't halt planned movement for empty group #1274

merged 3 commits into from
Jan 17, 2020

Conversation

Vdauphin
Copy link
Contributor

@Vdauphin Vdauphin commented Jan 3, 2020

CBA_fnc_clearWaypoints can be call for empty group. In this case, a waypoint is created at [0,0,0] because getPosATL (leader _group). This waypoint is unnecessary in case of empty group because there is no reason to "halt all planned movement".

When merged this pull request will:

  • This pull request avoid the creation of a waypoint for empty group.
  • Each change in a separate line
    • Check if group is not empty
    • Create the waypoint if there is at least a unit in the group

CBA_fnc_clearWaypoints can be call for empty group. This avoid the creation of a waypoint at [0,0,0] because getPosATL (leader _group)
@commy2
Copy link
Contributor

commy2 commented Jan 3, 2020

Does the WP at [0,0,0] for the empty group cause any issues?

@Vdauphin
Copy link
Contributor Author

Vdauphin commented Jan 3, 2020

I am using CBA_fnc_taskPatrol which is calling CBA_fnc_clearWaypoints
All groups look stuck and don't start the patrol
20200103162638_1

@Vdauphin
Copy link
Contributor Author

Vdauphin commented Jan 3, 2020

Here is the code I am using to identify the issue:

private _group = createGroup side player;  
[_group, getpos player, 100, 2 + floor (random 4), "MOVE", "SAFE", "RED", "LIMITED", "STAG COLUMN", "", [5, 10, 20]] call CBA_fnc_taskPatrol;  

[_group] spawn { 
   _group = _this select 0;
   sleep 10;
   _group createUnit [typeOf player, getpos player, [], 0, "CARGO"];  
   btc_curator addCuratorEditableObjects [units _group, false];
}

@commy2 commy2 added this to the 3.14 milestone Jan 17, 2020
@commy2 commy2 added the Bug Fix label Jan 17, 2020
@commy2 commy2 merged commit 0c8607d into CBATeam:master Jan 17, 2020
@Vdauphin Vdauphin deleted the clearWaypoints_emptyGroup_case branch January 17, 2020 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants