mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 15:33:29 +00:00
improved router entity add and remove function
This commit is contained in:
@@ -20,19 +20,24 @@ params ["_logic"];
|
|||||||
if (!local _logic) exitWith {};
|
if (!local _logic) exitWith {};
|
||||||
|
|
||||||
private _unit = attachedTo _logic;
|
private _unit = attachedTo _logic;
|
||||||
deleteVehicle _logic;
|
|
||||||
|
|
||||||
switch (false) do {
|
switch (false) do {
|
||||||
case (!isNull _unit): {
|
case (!isNull _unit): {
|
||||||
deleteVehicle _logic;
|
|
||||||
["Nothing selected", "error", "TCP Socket"] call EFUNC(main,notify);
|
["Nothing selected", "error", "TCP Socket"] call EFUNC(main,notify);
|
||||||
|
deleteVehicle _logic;
|
||||||
};
|
};
|
||||||
default {
|
default {
|
||||||
|
if (_unit in (missionNamespace getVariable ["armatak_marked_units", []])) exitWith {
|
||||||
|
["Unit already marked", "warning", "TCP Socket"] call EFUNC(main,notify);
|
||||||
|
deleteVehicle _logic;
|
||||||
|
};
|
||||||
|
|
||||||
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
GVAR(syncedUnits) = missionNamespace getVariable "armatak_marked_units";
|
||||||
|
|
||||||
GVAR(syncedUnits) pushBack _unit;
|
GVAR(syncedUnits) pushBack _unit;
|
||||||
|
|
||||||
missionNamespace setVariable ["armatak_marked_units", GVAR(syncedUnits)];
|
missionNamespace setVariable ["armatak_marked_units", GVAR(syncedUnits)];
|
||||||
|
SETVAR(_unit,GVAR(isRouting),true);
|
||||||
|
|
||||||
deleteVehicle _logic;
|
deleteVehicle _logic;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ switch (false) do {
|
|||||||
} forEach GVAR(syncedUnits);
|
} forEach GVAR(syncedUnits);
|
||||||
|
|
||||||
missionNmaespace setVariable ["armatak_marked_units", GVAR(syncedUnits)];
|
missionNmaespace setVariable ["armatak_marked_units", GVAR(syncedUnits)];
|
||||||
|
SETVAR(_unit,GVAR(isRouting),false);
|
||||||
|
|
||||||
deleteVehicle _logic;
|
deleteVehicle _logic;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user