Skip to content

Commit

Permalink
Scopes - Stop changing CBA setting value directly (#9954)
Browse files Browse the repository at this point in the history
Update XEH_postInit.sqf
  • Loading branch information
johnb432 authored Apr 19, 2024
1 parent dda6b9d commit 7480ae3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions addons/scopes/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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]];

["CBA_settingsInitialized", {

if (!GVAR(enabled)) exitWith {};

if (GVAR(deduceBarometricPressureFromTerrainAltitude)) then {
GVAR(zeroReferenceBarometricPressure) = 1013.25 * (1 - (0.0065 * EGVAR(common,mapAltitude)) / 288.15) ^ 5.255754495;
// Overwrite setting if automatic pressure deduction is wanted
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
Expand All @@ -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
["ace_firedPlayer", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler;
["ace_firedPlayerNonLocal", LINKFUNC(firedEH)] call CBA_fnc_addEventHandler;

}] call CBA_fnc_addEventHandler;

0 comments on commit 7480ae3

Please sign in to comment.