mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
635b667a74
* 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
34 lines
1.2 KiB
Plaintext
34 lines
1.2 KiB
Plaintext
#include "script_component.hpp"
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
["ace_settingsInitialized", {
|
|
// if not enabled, then bugger off.
|
|
if !(GVAR(enabled)) exitWith {};
|
|
|
|
// Limit on load
|
|
[false] call FUNC(adaptViewDistance);
|
|
|
|
// Set the EH which waits for any of the view distance settings to be changed, so that the effect is show immediately
|
|
["ace_settingChanged",{
|
|
params ["_name"];
|
|
if ((_name == QGVAR(viewDistanceOnFoot)) ||
|
|
(_name == QGVAR(viewDistanceLandVehicle)) ||
|
|
(_name == QGVAR(viewDistanceAirVehicle)) ||
|
|
(_name == QGVAR(objectViewDistanceCoeff))) then {
|
|
|
|
[true] call FUNC(adaptViewDistance);
|
|
};
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
// Set the EH which waits for a vehicle change to automatically swap between On Foot/In Land Vehicle/In Air Vehicle
|
|
// Also run when SettingsInitialized runs (not guaranteed)
|
|
["vehicle",{
|
|
[false] call FUNC(adaptViewDistance);
|
|
}] call CBA_fnc_addPlayerEventHandler;
|
|
["ACE_controlledUAV", {
|
|
[false] call FUNC(adaptViewDistance);
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
}] call CBA_fnc_addEventHandler;
|