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

Update fnc_headDir #390

Merged
merged 3 commits into from
Jun 23, 2016
Merged

Update fnc_headDir #390

merged 3 commits into from
Jun 23, 2016

Conversation

654wak654
Copy link
Contributor

When merged this PR will:

  1. Update the function using new commands
  2. Clean old code

Updated the function with new commands
Cleaned old code
_azimuth = (_vector select 0) atan2 (_vector select 1);
_azimuth = [_azimuth] call CBA_fnc_simplifyAngle;
};

_dif = _angle - _azimuth;
private _diff = -_azimuth;
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks much cleaner, but what happened to _angle ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

roger

@commy2 commy2 added this to the 2.4.2 milestone Jun 22, 2016
Add type checking for first param
Use fnc_currentUnit instead of player
Fix ASL positions
Bring back ability to calculate offset from anything

if (!isNull _offsetObject) then {
ADD(_diff,_unit getDir ([_offsetObject] call CBA_fnc_getPos));
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't this error if _offsetobject is a marker (STRING)?

Copy link
Contributor Author

@654wak654 654wak654 Jun 22, 2016

Choose a reason for hiding this comment

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

This could work:

    ["_offsetObject", ""]

    later on:
if !(_offsetObject isEqualTo "") then {

Update: It does work.

@@ -75,8 +75,8 @@ if (_unit != call CBA_fnc_currentUnit) then {

private _diff = -_azimuth;

if (!isNull _offsetObject) then {
ADD(_diff,_unit getDir ([_offsetObject] call CBA_fnc_getPos));
if !(_offset isEqualTo "") then {
Copy link
Contributor

Choose a reason for hiding this comment

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

but now it no longer works for markers at all, or am I wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you supply any other string than an empty string, it will return true:
!("base_marker" isEqualTo "") will return true.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah. I read it as isEqualType

@Killswitch00 Killswitch00 merged commit a16d8aa into CBATeam:master Jun 23, 2016
@654wak654 654wak654 deleted the patch-1 branch June 23, 2016 19:09
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

3 participants