mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
commit
d6dde3c73f
@ -28,14 +28,9 @@ _sideNearest = [];
|
||||
if ([_x] call FUNC(isValidAi) && (side group _x in _sides)) then {
|
||||
_sideNearest pushBack _x;
|
||||
};
|
||||
} forEach (nearestObjects [_pos, ["Man"], 20]);
|
||||
|
||||
} forEach (nearestObjects [_pos, ["Man"], 15]);
|
||||
|
||||
if (count _sideNearest > 0) then {
|
||||
private ["_switchUnit"];
|
||||
|
||||
_switchUnit = _sideNearest select 0;
|
||||
[ACE_player, _switchUnit] call FUNC(switchUnit);
|
||||
|
||||
[_sideNearest select 0] call FUNC(switchUnit);
|
||||
openMap false;
|
||||
};
|
||||
|
@ -17,8 +17,6 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_playerUnit", "_sides"];
|
||||
|
||||
PARAMS_2(_playerUnit,_sides);
|
||||
|
||||
if (vehicle _playerUnit == _playerUnit) then {
|
||||
|
@ -16,13 +16,10 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
|
||||
private "_player";
|
||||
_player = _this select 0;
|
||||
|
||||
PARAMS_1(_player);
|
||||
|
||||
if (GVAR(EnableSwitchUnits)) then {
|
||||
private ["_sides"];
|
||||
private "_sides";
|
||||
_sides = [];
|
||||
|
||||
if(GVAR(SwitchToWest)) then {_sides pushBack west;};
|
||||
|
@ -32,11 +32,11 @@ if (GVAR(EnableSafeZone)) then {
|
||||
|
||||
_allNearestPlayers = [position _unit, GVAR(SafeZoneRadius)] call FUNC(nearestPlayers);
|
||||
_nearestEnemyPlayers = [_allNearestPlayers, {((side GVAR(OriginalGroup)) getFriend (side _this) < 0.6) && !(_this getVariable [QGVAR(IsPlayerControlled), false])}] call EFUNC(common,filter);
|
||||
|
||||
|
||||
if (count _nearestEnemyPlayers > 0) exitWith {
|
||||
_leave = true;
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
// exitWith doesn't exit past the "if(EnableSafeZone)" block
|
||||
@ -56,14 +56,14 @@ DFUNC(pfhSwitchUnit) = {
|
||||
|
||||
private ["_args", "_unit", "_oldUnit", "_respawnEhId", "_oldOwner"];
|
||||
_args = _this select 0;
|
||||
|
||||
|
||||
_unit = _args select 0;
|
||||
_oldUnit = _args select 1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (local _unit) exitWith {
|
||||
|
||||
|
||||
_oldUnit setVariable [QGVAR(IsPlayerControlled), false, true];
|
||||
_oldUnit setVariable [QGVAR(PlayerControlledName), "", true];
|
||||
|
||||
@ -89,9 +89,9 @@ DFUNC(pfhSwitchUnit) = {
|
||||
};
|
||||
|
||||
[localize "STR_ACE_SwitchUnits_SwitchedUnit"] call EFUNC(common,displayTextStructured);
|
||||
|
||||
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user