mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
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:
parent
1921c73ee8
commit
01ee35d6c5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user