Geforces: Fix "Error Zero divisor"

Adds some simple checks before dividing.
Before dropping uniform or playing as a dog would throw script error.
This commit is contained in:
PabstMirror 2015-02-01 13:09:17 -06:00
parent 1921c73ee8
commit 01ee35d6c5

View File

@ -60,7 +60,15 @@ if (count GVAR(GForces) > 0) then {
_classCoef = ACE_player getVariable ["ACE_GForceCoef",
getNumber (configFile >> "CfgVehicles" >> (typeOf ACE_player) >> "ACE_GForceCoef")];
_suitCoef = getNumber (configFile >> "CfgWeapons" >> (uniform ACE_player) >> "ACE_GForceCoef");
_suitCoef = if ((uniform ACE_player) != "") then {
getNumber (configFile >> "CfgWeapons" >> (uniform ACE_player) >> "ACE_GForceCoef")
} else {
1
};
//Fix "Error Zero divisor"
if (_classCoef == 0) then {_classCoef = 0.001};
if (_suitCoef == 0) then {_suitCoef = 0.001};
_gBlackOut = MAXVIRTUALG / _classCoef + MAXVIRTUALG / _suitCoef - MAXVIRTUALG;
_gRedOut = MINVIRTUALG / _classCoef;