Merge pull request #1913 from acemod/improveSwitchUnits

Improve SwitchUnits
This commit is contained in:
Glowbal 2015-07-26 21:13:21 +02:00
commit 0af6c5d852
2 changed files with 12 additions and 4 deletions

View File

@ -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];

View File

@ -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;
};
};