Fix undefined variable when SingleCurrency is not used

This commit is contained in:
A Man
2022-04-12 09:37:00 +02:00
parent 9795527036
commit 495d7dfa0d
2 changed files with 3 additions and 5 deletions

View File

@@ -98,13 +98,11 @@ if (Z_SingleCurrency) then {
_canBuy = [_weaponsToBuy,[_pistolMagsToBuy,_regularMagsToBuy],_backpacksToBuy,_toolsToBuy,_sidearmToBuy,_primaryToBuy,_vehiclesToBuy,_toolClasses,_toolAmounts] call Z_allowBuying;
if (!_canBuy) exitWith {}; // Keep systemChat reasons for failure in Z_allowBuying for sanity
_wealth = player getVariable[(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_wealth = player getVariable[(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= _priceToBuy);
} else {
_moneyInfo = _priceToBuy call Z_canAfford;

View File

@@ -39,9 +39,9 @@ if (_disabled) exitWith {[_reason,1] call dayz_rollingMessages};
_enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
if (Z_SingleCurrency) then {
_wealth = player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
_enoughMoney = (_wealth >= _amount);
} else {
Z_Selling = false;