From 495d7dfa0ddb807ddbd8d5895c875adfdc542c94 Mon Sep 17 00:00:00 2001 From: A Man Date: Tue, 12 Apr 2022 09:37:00 +0200 Subject: [PATCH] Fix undefined variable when SingleCurrency is not used --- .../actions/AdvancedTrading/functions/z_at_buyItems.sqf | 6 ++---- SQF/dayz_code/actions/servicePoints/servicePointActions.sqf | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf index b580365ae..ac054f8e1 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf @@ -98,14 +98,12 @@ 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 { - _enoughMoney = (_wealth >= _priceToBuy); + _wealth = player getVariable[(["cashMoney","globalMoney"] select Z_persistentMoney),0]; + _enoughMoney = (_wealth >= _priceToBuy); } else { _moneyInfo = _priceToBuy call Z_canAfford; _enoughMoney = _moneyInfo select 0; diff --git a/SQF/dayz_code/actions/servicePoints/servicePointActions.sqf b/SQF/dayz_code/actions/servicePoints/servicePointActions.sqf index 40dcec70a..9273a403d 100644 --- a/SQF/dayz_code/actions/servicePoints/servicePointActions.sqf +++ b/SQF/dayz_code/actions/servicePoints/servicePointActions.sqf @@ -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;