Added view distance set on module load, so it is guaranteed to be set

This commit is contained in:
jonpas 2015-08-22 00:33:16 +02:00
parent fe9e4fee07
commit 295acddc7a

View File

@ -6,6 +6,9 @@ if (!hasInterface) exitWith {};
// 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
["SettingChanged",{
if ((_this select 0 == QGVAR(viewDistanceOnFoot)) ||
@ -18,7 +21,7 @@ if (!hasInterface) exitWith {};
}] call EFUNC(common,addEventHandler);
// Set the EH which waits for a vehicle change to automatically swap between On Foot/In Land Vehicle/In Air Vehicle
// Will also run when SettingsInitialized runs and take care of the limit on load
// Also run when SettingsInitialized runs (not guaranteed)
["playerVehicleChanged",{
[false] call FUNC(adaptViewDistance)
}] call EFUNC(common,addEventHandler);