From c9efb9e9df8d7922277f4b779447eb9ab49e24d1 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Fri, 29 Jul 2016 11:41:44 -0400 Subject: [PATCH] Fix some undefined variables in Adv Trade systemChat messages Fixes "Cannot sell any, tires are too damaged." and empty string in success message. --- .../actions/AdvancedTrading/functions/z_at_buyItems.sqf | 2 +- .../actions/AdvancedTrading/functions/z_at_sellItems.sqf | 4 ++-- 2 files changed, 3 insertions(+), 3 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 5754ea3a3..7302c70b3 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf @@ -222,7 +222,7 @@ if(_enoughMoney) then { if (_success) then { _tCost = ""; _tCost = _priceToBuy call z_calcDefaultCurrencyNoImg; - systemChat format[localize "STR_EPOCH_TRADE_BUY_SUCCESS", _tCost]; + if (_tCost != "") then { systemChat format[localize "STR_EPOCH_TRADE_BUY_SUCCESS",_tCost]; }; } else { systemChat localize "STR_EPOCH_TRADE_DEBUG"; }; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf index c1d4def8d..3492877dc 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf @@ -56,7 +56,7 @@ _sellVehicle = { if(_okToSell) then { _returnInfo = [_objectCharacterId, _obj, _objectID, _objectUID, _sellType]; } else { - systemChat format[localize "str_epoch_player_182",_textPartIn]; _returnInfo = []; + systemChat format[localize "str_epoch_player_182",typeOf _obj]; _returnInfo = []; }; } else { systemChat localize "str_epoch_player_245"; _returnInfo = []; @@ -221,7 +221,7 @@ if (typeName _money == "SCALAR") then { _success = [_money, 0] call Z_returnChange; _tCost = ""; _tCost = _money call z_calcDefaultCurrencyNoImg; - systemChat format[localize "STR_EPOCH_TRADE_SELL_SUCCESS",_tCost]; + if (_tCost != "") then { systemChat format[localize "STR_EPOCH_TRADE_SELL_SUCCESS",_tCost]; }; }; _itemsToLog call Z_logTrade; } else {