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

Make fnc_headDir compatible with the 1.54 ports #405

Merged
merged 2 commits into from
Jul 3, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions addons/common/fnc_headDir.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ if (_unit != call CBA_fnc_currentUnit) then {
private _diff = -_azimuth;

if !(_offset isEqualTo "") then {
#ifndef LINUX_BUILD
ADD(_diff,_unit getDir ([_offset] call CBA_fnc_getPos));
#else
ADD(_diff,[_unit, [_offset] call CBA_fnc_getPos] call BIS_fnc_dirTo);
Copy link
Member

Choose a reason for hiding this comment

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

missing ARR_x macro?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like ARR_2(_unit,[_offset] call CBA_fnc_getPos) ?

Copy link
Member

Choose a reason for hiding this comment

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

yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm... ARR_x, despite what the name suggests doesn't actually create an array for you.

Copy link
Member

Choose a reason for hiding this comment

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

ADD(_diff,[ARR_2(_unit, [_offset] call CBA_fnc_getPos)] call BIS_fnc_dirTo);
this is how it must look like ARR_2 must be use because of some issues with the preprocessor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I know. I was just thinking out loud... :-)

#endif
};
if (_diff < 0) then {
ADD(_diff,360);
Expand Down
2 changes: 2 additions & 0 deletions addons/common/fnc_headDir_Linux.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define LINUX_BUILD
#include "fnc_headDir.sqf"
5 changes: 5 additions & 0 deletions addons/linux/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class CfgFunctions {
};
};
class CBA {

class Anims {
F_FILEPATH(common,headDir);
};

class Entities {
F_FILEPATH(common,getAlive);
F_FILEPATH(common,getMagazineIndex);
Expand Down