-
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
Enhance patrol pattern of taskPatrol #572
Conversation
- Fix potential for error if input params are nil - Fix weird bug where calling from unit init in editor places all waypoints on one spot - Place waypoints on a semi-random pattern to produce patrols that cover the whole radius and make more sense
@@ -46,25 +51,30 @@ _position = _position call CBA_fnc_getPos; | |||
// Clear existing waypoints first | |||
[_group] call CBA_fnc_clearWaypoints; | |||
|
|||
// Can pass paremeters straight through to addWaypoint | |||
private _this =+ _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.
Something else.
_this =+ _this
.
Or assign a new variable. Scope of _this
already is set, so there is no point in that private
.
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.
Ah wasn't sure about this one 👍
Not much of a christmas person either, huh? |
😆 More that it's one of the few times of year I have a lot of free time and everywhere is super busy. Excluding the actual 25th it's all coding and gym for me 💪 |
private _rad = _radius*random [0.1, 0.75, 1]; | ||
|
||
// Alternate sides of circle & modulate offset | ||
private _theta = (_i%2)*180 + sin(deg(_step*_i))*_offset + _step*_i; |
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.
why does only + have spaces?
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.
No specific reason, this is just how I tend to write calculations (probably because I'm used to seeing algebraic expressions all the time in engineering)
case 2 : {_this pushBack _radius}; | ||
default {}; | ||
}; | ||
// Can pass paremeters straight through to addWaypoint |
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.
parameters
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.
Fixed!
the whole radius and make more sense