ACE3/addons/respawn/functions/fnc_canMoveRallypoint.sqf

31 lines
802 B
Plaintext
Raw Normal View History

/*
2015-09-26 14:26:41 +00:00
* 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"
2015-01-12 09:07:03 +00:00
2015-09-26 14:26:41 +00:00
params ["_unit", "_side"];
2015-01-12 09:07:03 +00:00
2015-09-26 14:26:41 +00:00
// player has to be a rallypoint mover. group leader by default
if !(_unit getVariable ["ACE_canMoveRallypoint", false]) exitWith {false};
2015-01-12 09:49:21 +00:00
2015-09-26 14:26:41 +00:00
// rallypoint of that side has to exist
!isNull ([
2015-01-13 14:28:03 +00:00
objNull,
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
2015-09-26 14:26:41 +00:00
] select ([west, east, independent] find _side) + 1) // return