ACE3/addons/interact_menu/functions/fnc_splitPath.sqf

27 lines
559 B
Plaintext
Raw Normal View History

/*
2015-03-24 04:18:00 +00:00
* Author: esteldunedain
* Take full path and split it between parent path and action name
*
2016-06-18 09:50:41 +00:00
* Arguments:
* Full path of the action to remove <ARRAY>
*
2016-06-18 09:50:41 +00:00
* Return Value:
* 0: Parent path <ARRAY>
* 1: Action name <STRING>
*
* Public: No
*/
#include "script_component.hpp"
2016-01-08 04:43:37 +00:00
private _parentPath = [];
for [{private _i = 0},{_i < (count _this) - 1},{_i = _i + 1}] do {
_parentPath pushBack (_this select _i);
};
2016-01-08 04:43:37 +00:00
private _actionName = if (count _this > 0) then {
_this select ((count _this) - 1);
2015-03-21 12:37:01 +00:00
} else {
""
2015-03-21 12:37:01 +00:00
};
[_parentPath, _actionName]