Scopes - Stop changing CBA setting value directly (#9954)

Update XEH_postInit.sqf
This commit is contained in:
johnb432 2024-04-19 19:27:04 +02:00 committed by GitHub
parent dda6b9d2dc
commit 7480ae377d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,11 +19,13 @@ GVAR(canAdjustWindage) = [false, false, false];
GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]]; GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]];
["CBA_settingsInitialized", { ["CBA_settingsInitialized", {
if (!GVAR(enabled)) exitWith {}; if (!GVAR(enabled)) exitWith {};
if (GVAR(deduceBarometricPressureFromTerrainAltitude)) then { // Overwrite setting if automatic pressure deduction is wanted
GVAR(zeroReferenceBarometricPressure) = 1013.25 * (1 - (0.0065 * EGVAR(common,mapAltitude)) / 288.15) ^ 5.255754495; if (isServer && GVAR(deduceBarometricPressureFromTerrainAltitude)) then {
private _referencePressure = 1013.25 * (1 - (0.0065 * EGVAR(common,mapAltitude)) / 288.15) ^ 5.255754495;
[QGVAR(zeroReferenceBarometricPressure), _referencePressure, 2, "server"] call CBA_settings_fnc_set;
}; };
// Check inventory when it changes // Check inventory when it changes
@ -47,5 +49,4 @@ GVAR(scopeAdjust) = [[[0,0],0,[0,0],0], [[0,0],0,[0,0],0], [[0,0],0,[0,0],0]];
// Register fire event handler // Register fire event handler
["ace_firedPlayer", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler; ["ace_firedPlayer", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler;
["ace_firedPlayerNonLocal", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler; ["ace_firedPlayerNonLocal", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler;
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;