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

Minimum distance check for AAF Road Patrol #3031

Merged

Conversation

ante185
Copy link

@ante185 ante185 commented Nov 4, 2023

What type of PR is this.

  1. Bug
  2. Change
  3. Enhancement

What have you changed and why?

Information:
Filters out patrol starting locations that which have players within 350m

Please specify which Issue this PR Resolves.

Should close #2589

Please verify the following and ensure all checks are completed.

  1. Have you loaded the mission in LAN host?
  2. Have you loaded the mission on a dedicated server?

Is further testing or are further changes required?

  1. No
  2. Yes (Please provide further detail below.)

How can the changes be tested?

Steps:
Run "[] spawn A3A_fnc_AAFroadPatrol" when close and further away from a valid location.
Changes:
the check for players distance may need to be increased as 250 350 might be a little short.


Notes:
The hard limit on tries is something i admit i feel dubious about, it is probably fine as is.
Because of the exitWith if _startBases is empty it cannot go into a infinite loop, _limit only exists as a performance save.

@Bob-Murphy Bob-Murphy added this to the Not organized yet milestone Nov 4, 2023
@jaj22
Copy link

jaj22 commented Nov 4, 2023

Better to add the inAreaArray as a one-liner to the select at around line 17 instead, as that's already condition-filtering. I feel like there was a reason why I didn't do that earlier but I was probably just being picky. Can rewrite it properly later anyway.

@ante185
Copy link
Author

ante185 commented Nov 4, 2023

Better to add the inAreaArray as a one-liner to the select at around line 17 instead, as that's already condition-filtering. I feel like there was a reason why I didn't do that earlier but I was probably just being picky. Can rewrite it properly later anyway.

From what i understand the code _bases is used for both as starting locations and locations that the patrol will visit, so putting the check up there at 17 would exclude outposts and locations that the player is at from being visited

@jaj22
Copy link

jaj22 commented Nov 5, 2023

I've checked. _bases isn't touched after the selectRandom. Patrol destinations are generated separately by feeding A3A_fnc_patrolDestinations with all markers of the patrolling side. So no reason why the one-liner wouldn't work.

Ideally the origin base check includes non-player spawners and doesn't include airborne units. Could probably be a bit larger too, although there's no path check so there's some risk of ending up on the wrong island.

@ante185
Copy link
Author

ante185 commented Nov 5, 2023

Changed to a one line filter

Copy link

@jaj22 jaj22 left a comment

Choose a reason for hiding this comment

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

Would have split that into two ifs, but it'll do for now. Function needs a lot of work later anyway.

@jaj22 jaj22 added Change A change to existing functionality Ready for merge labels Nov 6, 2023
@Bob-Murphy Bob-Murphy modified the milestones: Not organized yet, 3.5 Nov 17, 2023
@jaj22 jaj22 modified the milestones: 3.5, 3.4.1 Nov 22, 2023
@Bob-Murphy Bob-Murphy merged commit d378e1c into official-antistasi-community:unstable Nov 23, 2023
Bob-Murphy pushed a commit that referenced this pull request Dec 23, 2023
* Update fn_AAFroadPatrol.sqf

* Split IF statement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Change A change to existing functionality Ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Road patrols can spawn close to players
3 participants