ACE3/addons/respawn/functions/fnc_canMoveRallypoint.sqf
2015-09-26 16:28:18 +02:00

31 lines
802 B
Plaintext

/*
* Author: commy2
* Checks if a unit can move a rally point.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Side <SIDE>
*
* Return Value:
* Can move <BOOL>
*
* Example:
* [ACE_Player, side ACE_Player] call ace_respawn_fnc_canMoveRallypoint
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_side"];
// player has to be a rallypoint mover. group leader by default
if !(_unit getVariable ["ACE_canMoveRallypoint", false]) exitWith {false};
// rallypoint of that side has to exist
!isNull ([
objNull,
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
] select ([west, east, independent] find _side) + 1) // return