From 6650f70c934333e8a171cf51adaf0adc2d8b2f03 Mon Sep 17 00:00:00 2001 From: kitty624 <58940527+kitty624@users.noreply.github.com> Date: Mon, 15 Apr 2024 01:08:41 +0200 Subject: [PATCH 1/6] Update AimMembers.cpp reworking r9343 - this resulted in player being forced to choose features to allways see all possible merc gear sets - loosing whole gearsets to avoid a few items is too much - in some item-mods that even could result in some mercs not having any - therefore deleted --- Laptop/AimMembers.cpp | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/Laptop/AimMembers.cpp b/Laptop/AimMembers.cpp index d0f0561f7..aa0450337 100644 --- a/Laptop/AimMembers.cpp +++ b/Laptop/AimMembers.cpp @@ -5633,28 +5633,15 @@ void EnableWeaponKitSelectionButtons() { if ( !(gMercProfiles[gbCurrentSoldier].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) || gGameExternalOptions.fGearKitsAlwaysAvailable ) { - bool bShow; - INT16 usItem; for(int i=0; i Date: Mon, 15 Apr 2024 01:17:18 +0200 Subject: [PATCH 2/6] Update ShopKeeper Interface.cpp reworking r9343 - already decided in IsItemlegal - if it ain't legal, it won't be shown in ShopKeeperInventory, no need to bother with it again --- Tactical/ShopKeeper Interface.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Tactical/ShopKeeper Interface.cpp b/Tactical/ShopKeeper Interface.cpp index 427a0fc59..505ce3774 100644 --- a/Tactical/ShopKeeper Interface.cpp +++ b/Tactical/ShopKeeper Interface.cpp @@ -2896,13 +2896,6 @@ BOOLEAN DetermineArmsDealersSellingInventory( ) continue; } - //shadooow: do not sell any item that is limited to specific system and this system isn't enabled - if (((Item[iter->object.usItem].usLimitedToSystem & FOOD_SYSTEM_FLAG) && !UsingFoodSystem()) || ((Item[iter->object.usItem].usLimitedToSystem & DISEASE_SYSTEM_FLAG) && !gGameExternalOptions.fDisease)) - { - ++iter; - continue; - } - bool increment = true; if (ItemIsSpecial(*iter) == false) { StoreObjectsInNextFreeDealerInvSlot( &(*iter), gpTempDealersInventory, gbSelectedArmsDealerID ); From e386a66f0318107263c90449951b5ca547469174 Mon Sep 17 00:00:00 2001 From: kitty624 <58940527+kitty624@users.noreply.github.com> Date: Mon, 15 Apr 2024 01:22:26 +0200 Subject: [PATCH 3/6] Update Item Types.h reworking r9343 - no need for Foodsystem flag, restricting food items to food system was already part of the code prior to r9343 (in IsItemLegal by silversurfer) - for disease system changed flag to boolean --- Tactical/Item Types.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Tactical/Item Types.h b/Tactical/Item Types.h index 4fbfb6504..3d82e35e7 100644 --- a/Tactical/Item Types.h +++ b/Tactical/Item Types.h @@ -947,9 +947,6 @@ extern OBJECTTYPE gTempObject; // autofiretohitbonus, // bursttohitbonus -// bitflags for usLimitedToSystem -#define FOOD_SYSTEM_FLAG 1 -#define DISEASE_SYSTEM_FLAG 2 typedef struct { @@ -1218,8 +1215,9 @@ typedef struct BOOLEAN fProvidesRobotCamo; BOOLEAN fProvidesRobotNightVision; BOOLEAN fProvidesRobotLaserBonus; - //shadooow: bitflag controlling what system needs to be in play for item to appear - UINT8 usLimitedToSystem; + + // kitty: item exclusively available with disease feature + BOOLEAN DiseaseSystemExclusive; // rftr: the progress bounds that allow a transport group to drop an item INT8 iTransportGroupMinProgress; From 71667aba27fdb205582f9088d4c6d6a2bacb3545 Mon Sep 17 00:00:00 2001 From: kitty624 <58940527+kitty624@users.noreply.github.com> Date: Mon, 15 Apr 2024 01:26:50 +0200 Subject: [PATCH 4/6] Update XML_Items.cpp reworking r9343 - part about food system was obsolete, that was already a thing prior to r9343 (see IsItemLegal) - disease changed because instead of flag now boolean is used --- Utils/XML_Items.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Utils/XML_Items.cpp b/Utils/XML_Items.cpp index 5c1c37aec..b15fbc1bd 100644 --- a/Utils/XML_Items.cpp +++ b/Utils/XML_Items.cpp @@ -1515,17 +1515,10 @@ itemEndElementHandle(void *userData, const XML_Char *name) pData->curElement = ELEMENT; pData->curItem.fProvidesRobotLaserBonus = (BOOLEAN)atol(pData->szCharData); } - else if (strcmp(name, "FoodSystemExclusive") == 0) - { - pData->curElement = ELEMENT; - if (atol(pData->szCharData)) - pData->curItem.usLimitedToSystem|= FOOD_SYSTEM_FLAG; - } else if (strcmp(name, "DiseaseSystemExclusive") == 0) { - pData->curElement = ELEMENT; - if (atol(pData->szCharData)) - pData->curItem.usLimitedToSystem|= DISEASE_SYSTEM_FLAG; + pData->curElement = ELEMENT; + pData->curItem.DiseaseSystemExclusive = (BOOLEAN)atol(pData->szCharData); } else if (strcmp(name, "TransportGroupMinProgress") == 0) { @@ -2194,6 +2187,8 @@ BOOLEAN WriteItemStats() FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].fProvidesRobotNightVision ); FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].fProvidesRobotLaserBonus ); + FilePrintf(hFile, "\t\t%d\r\n", Item[cnt].DiseaseSystemExclusive); + FilePrintf(hFile,"\t\r\n"); } FilePrintf(hFile,"\r\n"); From b13bcaac7153b99c9157ee4891d18b518ddee679 Mon Sep 17 00:00:00 2001 From: kitty624 <58940527+kitty624@users.noreply.github.com> Date: Mon, 15 Apr 2024 01:33:47 +0200 Subject: [PATCH 5/6] Update Items.cpp reworking r9343 - the part about Food System is obsolete, already was happening in code prior to r9343 - the flags got removed and a boolean is used instead, allowing a simpler function for the remaining disease - wether an item is considered exclusive to disease feature or not is decided by usage of tag in items.xml --- Tactical/Items.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 6e3535525..6e154a04c 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -1279,8 +1279,9 @@ BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness ) return FALSE; } - //shadooow: exclude also any item that is limited to specific system and this system isn't enabled - if (((Item[usItemIndex].usLimitedToSystem & FOOD_SYSTEM_FLAG) && !UsingFoodSystem()) || ((Item[usItemIndex].usLimitedToSystem & DISEASE_SYSTEM_FLAG) && !gGameExternalOptions.fDisease)) + // kitty: no disease items if the disease system is off + // whether the item is exclusive is defined by tag + if (!gGameExternalOptions.fDisease && Item[usItemIndex].DiseaseSystemExclusive) { return FALSE; } From 3bab6ef3b7b6c785ad030145a3249a028aa792e0 Mon Sep 17 00:00:00 2001 From: kitty624 <58940527+kitty624@users.noreply.github.com> Date: Mon, 15 Apr 2024 02:28:49 +0200 Subject: [PATCH 6/6] Update XML_Items.cpp reworking r9343 - some leftover cleanup and formating --- Utils/XML_Items.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Utils/XML_Items.cpp b/Utils/XML_Items.cpp index b15fbc1bd..76652ae4c 100644 --- a/Utils/XML_Items.cpp +++ b/Utils/XML_Items.cpp @@ -306,7 +306,6 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at strcmp(name, "ProvidesRobotCamo") == 0 || strcmp(name, "ProvidesRobotNightVision") == 0 || strcmp(name, "ProvidesRobotLaserBonus") == 0 || - strcmp(name, "FoodSystemExclusive") == 0 || strcmp(name, "DiseaseSystemExclusive") == 0 || strcmp(name, "TransportGroupMinProgress") == 0 || strcmp(name, "TransportGroupMaxProgress") == 0 @@ -1517,8 +1516,8 @@ itemEndElementHandle(void *userData, const XML_Char *name) } else if (strcmp(name, "DiseaseSystemExclusive") == 0) { - pData->curElement = ELEMENT; - pData->curItem.DiseaseSystemExclusive = (BOOLEAN)atol(pData->szCharData); + pData->curElement = ELEMENT; + pData->curItem.DiseaseSystemExclusive = (BOOLEAN)atol(pData->szCharData); } else if (strcmp(name, "TransportGroupMinProgress") == 0) {