mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fixed viewdistance error while controlling UAV (#5308)
* Fixed viewdistance error while controlling UAV. When you take control of UAV drones, the view distance does not properly update to your setting because it thinks that you are still the land infantry guy. So I've experimented a bit in the editor and found a condition that will properly return true when you are in control of a drone aircraft. I've also adapted this for use with land-based UAV stuff (like the Stomper). To accomplish this, I created a private *_isControllingDrone* variable that will detect if the player is currently in control of any UAV. I also edited the _landVehicle and _airVehicle scripts so if and only *_isControllingDrone* returns true, then it will check whether the drone is a subclass of "LandVehicle" or an "Air". That's all I did. Please accept my pull request! * Use ACE_controlledUAV event
This commit is contained in:
parent
3869c8362f
commit
635b667a74
@ -26,4 +26,8 @@ if (!hasInterface) exitWith {};
|
|||||||
["vehicle",{
|
["vehicle",{
|
||||||
[false] call FUNC(adaptViewDistance);
|
[false] call FUNC(adaptViewDistance);
|
||||||
}] call CBA_fnc_addPlayerEventHandler;
|
}] call CBA_fnc_addPlayerEventHandler;
|
||||||
|
["ACE_controlledUAV", {
|
||||||
|
[false] call FUNC(adaptViewDistance);
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
@ -22,6 +22,12 @@ if (!GVAR(enabled) || isNull ACE_player) exitWith {};
|
|||||||
|
|
||||||
private _vehicle = vehicle ACE_player;
|
private _vehicle = vehicle ACE_player;
|
||||||
|
|
||||||
|
ACE_controlledUAV params ["_uav"];
|
||||||
|
if (!isNull _uav) then {
|
||||||
|
TRACE_1("using UAV",ACE_controlledUAV);
|
||||||
|
_vehicle = _uav;
|
||||||
|
};
|
||||||
|
|
||||||
private _landVehicle = _vehicle isKindOf "LandVehicle" || {_vehicle isKindOf "Ship_F"};
|
private _landVehicle = _vehicle isKindOf "LandVehicle" || {_vehicle isKindOf "Ship_F"};
|
||||||
private _airVehicle = _vehicle isKindOf "Air";
|
private _airVehicle = _vehicle isKindOf "Air";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user