2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-01-14 01:57:15 +00:00
|
|
|
Name: ACE_SwitchUnits_fnc_addMapFunction
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
Author(s):
|
|
|
|
bux578
|
|
|
|
|
|
|
|
Description:
|
|
|
|
Adds a mapClick Eventhandler
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
0: OBJECT - unit
|
2015-01-27 08:01:57 +00:00
|
|
|
1: ARRAY<OBJECT> - sides
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
Returns:
|
|
|
|
VOID
|
|
|
|
*/
|
|
|
|
|
2015-01-12 14:47:22 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-01-27 08:01:57 +00:00
|
|
|
private ["_unit", "_sides"];
|
2015-01-11 16:42:31 +00:00
|
|
|
_unit = _this select 0;
|
2015-01-27 08:01:57 +00:00
|
|
|
_sides = _this select 1;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
["theMapClick", "onMapSingleClick", {
|
2015-01-27 08:01:57 +00:00
|
|
|
|
|
|
|
if (alive ACE_player && {GVAR(OriginalUnit) getVariable ["ACE_CanSwitchUnits", false]}) then {
|
|
|
|
[_this, _pos, _shift, _alt] call FUNC(handleMapClick);
|
|
|
|
};
|
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
}, [_unit, _sides]] call BIS_fnc_addStackedEventHandler;
|