2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-03-21 12:37:01 +00:00
|
|
|
/*
|
2015-03-24 04:18:00 +00:00
|
|
|
* Author: esteldunedain
|
2015-03-21 12:37:01 +00:00
|
|
|
* Check if the first path is a subpath of the other
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2015-03-21 12:37:01 +00:00
|
|
|
* 0: LongPath <ARRAY>
|
|
|
|
* 1: ShortPath <STRING>
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* Bool <BOOL>
|
2015-03-21 12:37:01 +00:00
|
|
|
*
|
2016-01-08 04:43:37 +00:00
|
|
|
* Example:
|
|
|
|
* [[["ACE_SelfActions", player],["ace_Gestures", player]], [["ACE_SelfActions", player]]] call ace_interact_menu_fnc_isSubPath
|
|
|
|
*
|
2015-03-21 12:37:01 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-04 22:46:57 +00:00
|
|
|
params ["_longPath", "_shortPath"];
|
2015-03-21 12:37:01 +00:00
|
|
|
|
2016-01-08 04:43:37 +00:00
|
|
|
private _isSubPath = true;
|
2015-03-21 12:37:01 +00:00
|
|
|
|
|
|
|
if (count _shortPath > count _longPath) exitWith {false};
|
|
|
|
|
2017-05-31 21:09:36 +00:00
|
|
|
//IGNORE_PRIVATE_WARNING ["_i"];
|
2016-01-08 04:43:37 +00:00
|
|
|
for [{private _i = 0},{_i < count _shortPath},{_i = _i + 1}] do {
|
2021-02-27 17:05:05 +00:00
|
|
|
if ((_longPath select _i) isNotEqualTo (_shortPath select _i)) exitWith {
|
2015-03-21 12:37:01 +00:00
|
|
|
_isSubPath = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
_isSubPath
|