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

Enhance patrol pattern of taskPatrol #572

Merged
merged 2 commits into from
Jan 4, 2017
Merged

Enhance patrol pattern of taskPatrol #572

merged 2 commits into from
Jan 4, 2017

Conversation

kymckay
Copy link
Contributor

@kymckay kymckay commented Dec 24, 2016

  • 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

- 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;
Copy link
Contributor

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.

Copy link
Contributor Author

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 👍

@commy2
Copy link
Contributor

commy2 commented Dec 24, 2016

Not much of a christmas person either, huh?

@kymckay
Copy link
Contributor Author

kymckay commented Dec 24, 2016

😆 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;
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

parameters

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

@Killswitch00 Killswitch00 merged commit a2c5c4d into CBATeam:master Jan 4, 2017
@kymckay kymckay deleted the enhancePatrol branch January 5, 2017 15:53
@commy2 commy2 added this to the 3.2 milestone Jan 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants