mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #1913 from acemod/improveSwitchUnits
Improve SwitchUnits
This commit is contained in:
commit
0af6c5d852
@ -27,19 +27,22 @@ DFUNC(pfhMarkAiOnMap) = {
|
||||
_args = _this select 0;
|
||||
_sides = _args select 0;
|
||||
|
||||
|
||||
|
||||
// delete markers
|
||||
{
|
||||
deleteMarkerLocal _x;
|
||||
} forEach GVAR(AllMarkerNames);
|
||||
|
||||
if (alive ACE_player && {GVAR(OriginalUnit) getVariable ["ACE_CanSwitchUnits", false]}) then {
|
||||
|
||||
// reset the array
|
||||
GVAR(AllMarkerNames) = [];
|
||||
|
||||
if (alive ACE_player && {GVAR(OriginalUnit) getVariable ["ACE_CanSwitchUnits", false]}) then {
|
||||
|
||||
// create markers
|
||||
{
|
||||
if (([_x] call FUNC(isValidAi) && (side group _x in _sides)) || (_x getVariable [QGVAR(IsPlayerControlled), false])) then {
|
||||
private ["_markerName", "_marker", "_markerColor"];
|
||||
|
||||
|
||||
_markerName = str _x;
|
||||
|
||||
_marker = createMarkerLocal [_markerName, position _x];
|
||||
|
@ -28,6 +28,11 @@ DFUNC(pfhSwitchBack) = {
|
||||
if (local _originalPlayerUnit) exitWith {
|
||||
selectPlayer _originalPlayerUnit;
|
||||
deleteVehicle _currentUnit;
|
||||
|
||||
private "_layer";
|
||||
_layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer;
|
||||
_layer cuttext ["","plain"];
|
||||
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user