Advanced trading selling upgraded vehicles.

These changes allow the player to sell upgraded vehicles with them not
being added to the trader (as to not polute the lists). This basically
refers to an upgraded vehicle as a child of the base vehicle so it will
get the same sell price as the base vehicle.

This still follows the original trading convention, the vehicle base
needs to be in the trader category, i.e you cant sell an armored SUV at
stary vehicle trader.
This commit is contained in:
oiad
2016-08-19 22:15:47 +12:00
parent 554dad4e9e
commit d987fb290c
15 changed files with 51 additions and 3 deletions

View File

@@ -8,7 +8,7 @@
*
* Fills up the sell or buy list if the item has a valid config.
**/
private ["_weaps","_mags","_extraText","_all","_arrayOfTraderCat","_totalPrice","_backUpText","_bags"];
private ["_weaps","_mags","_extraText","_all","_arrayOfTraderCat","_totalPrice","_backUpText","_bags","_vehUpgraded"];
#include "defines.hpp"
_weaps = _this select 0;
@@ -18,6 +18,7 @@ _bags = _this select 3;
_vehTrade = false;
if (false call Z_checkCloseVehicle) then {
_vehUpgraded = getText (configFile >> 'CfgVehicles' >> typeOf (Z_vehicle) >> 'original');
_all = _weaps + _mags + _bags + [(typeOf Z_vehicle)];
_vehTrade = true;
} else {
@@ -54,6 +55,7 @@ _totalPrice = 0;
if (isNumber (missionConfigFile >> "CfgTraderCategory" >> _cat >> "duplicate")) then {
_cat = format["Category_%1",getNumber (missionConfigFile >> "CfgTraderCategory" >> _cat >> "duplicate")];
};
if (_vehUpgraded != "" && _vehTrade && _y == (typeOf Z_vehicle)) then { _y = _vehUpgraded; };
_exists = isClass(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y);
if (_exists) exitWith {
_pic = "";