Fix error from 95ab6a2

This commit is contained in:
ebayShopper
2017-04-05 15:59:15 -04:00
parent 4b14397c7b
commit 75cf8648d7

View File

@@ -8,7 +8,7 @@
* *
* Fills up the sell or buy list if the item has a valid config. * Fills up the sell or buy list if the item has a valid config.
**/ **/
private ["_weaps","_mags","_extraText","_all","_arrayOfTraderCat","_totalPrice","_backUpText","_bags","_vehUpgraded","_currencyQty","_swap"]; private ["_weaps","_mags","_extraText","_all","_arrayOfTraderCat","_totalPrice","_backUpText","_bags","_baseVehicle","_currencyQty","_swap","_swap2","_myVehType"];
#include "defines.hpp" #include "defines.hpp"
_weaps = _this select 0; _weaps = _this select 0;
@@ -16,11 +16,12 @@ _mags = _this select 1;
_extraText = _this select 2; _extraText = _this select 2;
_bags = _this select 3; _bags = _this select 3;
_vehTrade = false; _vehTrade = false;
_vehUpgraded = ""; _baseVehicle = "";
_myVehType = typeOf DZE_myVehicle;
if (false call Z_checkCloseVehicle) then { if (false call Z_checkCloseVehicle) then {
_vehUpgraded = getText (configFile >> 'CfgVehicles' >> typeOf (DZE_myVehicle) >> 'original'); _baseVehicle = getText (configFile >> "CfgVehicles" >> _myVehType >> "original");
_all = _weaps + _mags + _bags + [(typeOf DZE_myVehicle)]; _all = _weaps + _mags + _bags + [_myVehType];
_vehTrade = true; _vehTrade = true;
} else { } else {
_all = _weaps + _mags + _bags; _all = _weaps + _mags + _bags;
@@ -51,19 +52,23 @@ _totalPrice = 0;
{ {
_y = _x; _y = _x;
_swap = false; _swap = false;
if (dayz_classicBloodBagSystem && _y == "ItemBloodbag") then { _swap2 = false;
if (_y == "ItemBloodbag" && dayz_classicBloodBagSystem) then {
_y = "bloodBagONEG"; _y = "bloodBagONEG";
_swap = true; _swap = true;
}; };
if (_y == _myVehType && {_baseVehicle != ""}) then {
_swap2 = true;
};
{ {
private ["_cat","_exists","_pic","_text","_type","_sell","_buy","_buyCurrency","_sellCurrency","_worth"]; private ["_cat","_exists","_pic","_text","_type","_sell","_buy","_buyCurrency","_sellCurrency","_worth"];
_cat = format["Category_%1",(_arrayOfTraderCat select _forEachIndex select 1)]; _cat = format["Category_%1",(_arrayOfTraderCat select _forEachIndex select 1)];
if (isNumber (missionConfigFile >> "CfgTraderCategory" >> _cat >> "duplicate")) then { if (isNumber (missionConfigFile >> "CfgTraderCategory" >> _cat >> "duplicate")) then {
_cat = format["Category_%1",getNumber (missionConfigFile >> "CfgTraderCategory" >> _cat >> "duplicate")]; _cat = format["Category_%1",getNumber (missionConfigFile >> "CfgTraderCategory" >> _cat >> "duplicate")];
}; };
if (_vehUpgraded != "" && {typeOf DZE_myVehicle == _y} && {!isClass(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y)}) then { if (_swap2 && {!isClass(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y)} && {isClass(missionConfigFile >> "CfgTraderCategory" >> _cat >> _baseVehicle)}) then {
//Use base vehicle prices for upgraded _DZE[1-4] variants if they are not explicitly added in trader config //Use base vehicle prices for upgraded _DZE[1-4] variants only if they are not explicitly added in trader config
_y = _vehUpgraded; _y = _baseVehicle;
}; };
_exists = isClass(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y); _exists = isClass(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y);
if (_exists) exitWith { if (_exists) exitWith {
@@ -95,7 +100,7 @@ _totalPrice = 0;
if (isNil '_text') then { _text = _y; }; if (isNil '_text') then { _text = _y; };
_HasKey = true; _HasKey = true;
if (_vehTrade && {(typeOf DZE_myVehicle) == _y}) then { if (_vehTrade && {_y == _myVehType}) then {
if (!(_type in DZE_tradeVehicleKeyless) && DZE_SaleRequiresKey) then { if (!(_type in DZE_tradeVehicleKeyless) && DZE_SaleRequiresKey) then {
_HasKey = [DZE_myVehicle, _all] call _HasKeyCheck; _HasKey = [DZE_myVehicle, _all] call _HasKeyCheck;
}; };