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

ignore locked statics in taskDefend #1016

Merged
merged 2 commits into from
Oct 23, 2018
Merged

ignore locked statics in taskDefend #1016

merged 2 commits into from
Oct 23, 2018

Conversation

Cuel
Copy link
Contributor

@Cuel Cuel commented Oct 22, 2018

When merged this pull request will:

  • AI will not consider locked statics in taskDefend

fix #1013

@@ -58,7 +58,7 @@ private _statics = _position nearObjects ["StaticWeapon", _radius];
private _buildings = _position nearObjects ["Building", _radius];

// Filter out occupied statics
_statics = _statics select {(_x emptyPositions "Gunner") > 0};
_statics = _statics select {locked _x != 2 && {(_x emptyPositions "Gunner") > 0}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 - Unlocked; 1 - Default; 2 - Locked; 3 - Locked for player; -1 - vehicle is null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to also check for -1?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but this is really messy.

@Cuel
Copy link
Contributor Author

Cuel commented Oct 23, 2018

Fixed the first one but moduleDefend uses CBA_fnc_taskDefend which is fixed in first commit

@Cuel
Copy link
Contributor Author

Cuel commented Oct 23, 2018

On that note it might also be worth check for assignedGunner in these aswell, if taskDefend runs for two groups they should try to assign to the same static even if it's assigned but not mounted?

@commy2
Copy link
Contributor

commy2 commented Oct 23, 2018

Don't think that amount of micromanaging is necessary. It is possible for another AI or player to enter the vehicle before the assigned AI can reach for example, and that would still be not covered by that check.
At that point, it is the responsibility of the mission maker.

@commy2 commy2 added this to the 3.9.1 milestone Oct 23, 2018
@commy2 commy2 added the Bug Fix label Oct 23, 2018
@commy2
Copy link
Contributor

commy2 commented Oct 23, 2018

@Cuel ready to merge?

@Cuel
Copy link
Contributor Author

Cuel commented Oct 23, 2018

Yep sure.

@commy2 commy2 merged commit 994c674 into CBATeam:master Oct 23, 2018
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.

"CBA_fnc_taskDefend" does not ignore locked statics.
2 participants