From 0d4feed6bc5cf853beef268cd649fe296a69a61f Mon Sep 17 00:00:00 2001 From: Joaquine <47837195+Joaquinee@users.noreply.github.com> Date: Sat, 25 Apr 2020 01:30:57 +0200 Subject: [PATCH 1/2] add hasLicense in Config_vitems Add hasLicense in Config_Vitems Because people add more items here, and i better optimize --- Altis_Life.Altis/config/Config_vItems.hpp | 21 +++++++++++++++++++ .../core/actions/fn_processAction.sqf | 5 +++-- Altis_Life.Altis/script_macros.hpp | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Altis_Life.Altis/config/Config_vItems.hpp b/Altis_Life.Altis/config/Config_vItems.hpp index de3250a6e..2ca994847 100644 --- a/Altis_Life.Altis/config/Config_vItems.hpp +++ b/Altis_Life.Altis/config/Config_vItems.hpp @@ -137,6 +137,7 @@ class VirtualShops { * buyPrice = Item Buy Price * sellPrice = Item Sell Price * illegal = Illegal Item +* hasLicense = Item hasLicense traitement * edible = Item Edible (-1 = Disabled, other values = added value) * drinkable = Item Drinkable (-1 = Disabled, other values = added value) * icon = Item Icon @@ -310,6 +311,7 @@ class VirtualItems { buyPrice = -1; sellPrice = -1; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_oilUnprocessed.paa"; @@ -322,6 +324,7 @@ class VirtualItems { buyPrice = -1; sellPrice = 3200; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_oilProcessed.paa"; @@ -334,6 +337,7 @@ class VirtualItems { buyPrice = -1; sellPrice = -1; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_copperOre.paa"; @@ -346,6 +350,7 @@ class VirtualItems { buyPrice = -1; sellPrice = 1500; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_copper.paa"; @@ -358,6 +363,7 @@ class VirtualItems { buyPrice = -1; sellPrice = -1; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_ironOre.paa"; @@ -370,6 +376,7 @@ class VirtualItems { buyPrice = -1; sellPrice = 3200; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_iron.paa"; @@ -382,6 +389,7 @@ class VirtualItems { buyPrice = -1; sellPrice = -1; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_saltUnprocessed.paa"; @@ -394,6 +402,7 @@ class VirtualItems { buyPrice = -1; sellPrice = 1450; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_saltProcessed.paa"; @@ -406,6 +415,7 @@ class VirtualItems { buyPrice = -1; sellPrice = -1; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_sand.paa"; @@ -418,6 +428,7 @@ class VirtualItems { buyPrice = -1; sellPrice = 1450; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_glass.paa"; @@ -430,6 +441,7 @@ class VirtualItems { buyPrice = -1; sellPrice = 750; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_diamondUncut.paa"; @@ -442,6 +454,7 @@ class VirtualItems { buyPrice = -1; sellPrice = 2000; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_diamondCut.paa"; @@ -454,6 +467,7 @@ class VirtualItems { buyPrice = -1; sellPrice = -1; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_rock.paa"; @@ -466,6 +480,7 @@ class VirtualItems { buyPrice = -1; sellPrice = 1950; illegal = false; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_cement.paa"; @@ -479,6 +494,7 @@ class VirtualItems { buyPrice = -1; sellPrice = -1; illegal = true; + hasLicense = true; edible = -1; drinkable = -1; icon = "icons\ico_heroinUnprocessed.paa"; @@ -492,6 +508,7 @@ class VirtualItems { buyPrice = 3500; sellPrice = 2560; illegal = true; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_heroinProcessed.paa"; @@ -504,6 +521,7 @@ class VirtualItems { buyPrice = -1; sellPrice = -1; illegal = true; + hasLicense = true; edible = -1; drinkable = -1; icon = "icons\ico_cannabis.paa"; @@ -517,6 +535,7 @@ class VirtualItems { buyPrice = 2800; sellPrice = 2350; illegal = true; + hasLicense = true; edible = -1; drinkable = -1; icon = "icons\ico_marijuana.paa"; @@ -529,6 +548,7 @@ class VirtualItems { buyPrice = -1; sellPrice = -1; illegal = true; + hasLicense = true; edible = -1; drinkable = -1; icon = "icons\ico_cocaineUnprocessed.paa"; @@ -542,6 +562,7 @@ class VirtualItems { buyPrice = -1; sellPrice = 5000; illegal = true; + hasLicense = false; edible = -1; drinkable = -1; icon = "icons\ico_cocaineProcessed.paa"; diff --git a/Altis_Life.Altis/core/actions/fn_processAction.sqf b/Altis_Life.Altis/core/actions/fn_processAction.sqf index e47edc0b1..e62ece3b5 100644 --- a/Altis_Life.Altis/core/actions/fn_processAction.sqf +++ b/Altis_Life.Altis/core/actions/fn_processAction.sqf @@ -46,11 +46,12 @@ _totalConversions = []; if (_exit) exitWith {life_is_processing = false; hint localize "STR_NOTF_NotEnoughItemProcess"; life_action_inUse = false;}; -if (_vendor in [mari_processor,coke_processor,heroin_processor]) then { +if (ITEM_HASLICENSE(_type) isEqualTo 1) then { _hasLicense = true; } else { _hasLicense = LICENSE_VALUE(_type,"civ"); -}; +} + _cost = _cost * (count _oldItem); diff --git a/Altis_Life.Altis/script_macros.hpp b/Altis_Life.Altis/script_macros.hpp index d801ef85a..770aa8472 100644 --- a/Altis_Life.Altis/script_macros.hpp +++ b/Altis_Life.Altis/script_macros.hpp @@ -29,6 +29,7 @@ #define ITEM_SELLPRICE(varName) M_CONFIG(getNumber,"VirtualItems",varName,"sellPrice") #define ITEM_BUYPRICE(varName) M_CONFIG(getNumber,"VirtualItems",varName,"buyPrice") #define ITEM_NAME(varName) M_CONFIG(getText,"VirtualItems",varName,"displayName") +#define ITEM_HASLICENSE(varName) M_CONFIG(getNumber,"VirtualItems",varName,"hasLicense") //Condition Macros #define KINDOF_ARRAY(a,b) [##a,##b] call {_veh = _this select 0;_types = _this select 1;_res = false; {if (_veh isKindOf _x) exitWith { _res = true };} forEach _types;_res} From 70f0408f0b0247c404323d6dd569e83ad4c7403a Mon Sep 17 00:00:00 2001 From: Joaquine <47837195+Joaquinee@users.noreply.github.com> Date: Sat, 25 Apr 2020 01:41:35 +0200 Subject: [PATCH 2/2] Update fn_processAction.sqf --- Altis_Life.Altis/core/actions/fn_processAction.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Altis_Life.Altis/core/actions/fn_processAction.sqf b/Altis_Life.Altis/core/actions/fn_processAction.sqf index e62ece3b5..d6868dc68 100644 --- a/Altis_Life.Altis/core/actions/fn_processAction.sqf +++ b/Altis_Life.Altis/core/actions/fn_processAction.sqf @@ -50,7 +50,7 @@ if (ITEM_HASLICENSE(_type) isEqualTo 1) then { _hasLicense = true; } else { _hasLicense = LICENSE_VALUE(_type,"civ"); -} +}; _cost = _cost * (count _oldItem);