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

add Support for Waypoints to cba_fnc_getPos #1305

Merged
merged 4 commits into from
Mar 10, 2020
Merged
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
14 changes: 11 additions & 3 deletions addons/common/fnc_getPos.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Description:
A function used to get the position of an entity.

Parameters:
_entity - <MARKER, OBJECT, LOCATION, GROUP, TASK or POSITION>
_entity - <MARKER, OBJECT, LOCATION, GROUP, TASK, WAYPOINT or POSITION>

Example:
(begin example)
Expand Down Expand Up @@ -36,7 +36,11 @@ switch (typeName _entity) do {
getPos _entity
};
case "GROUP": {
getPos (leader _entity)
if (_this isEqualType [] && {_this isEqualTypeArray [grpNull, 0]}) then {
jokoho48 marked this conversation as resolved.
Show resolved Hide resolved
getWPPos _this;
} else {
getPos (leader _entity);
};
};
case "STRING": {
getMarkerPos _entity
Expand All @@ -48,7 +52,11 @@ switch (typeName _entity) do {
taskDestination _entity
};
case "ARRAY": {
+ _entity
if (_entity isEqualTypeArray [grpNull, 0]) then {
getWPPos _entity;
} else {
+ _entity;
jokoho48 marked this conversation as resolved.
Show resolved Hide resolved
};
};
case "SCALAR": { // in case of position being passed not in array
+ _this
Expand Down