mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Merge pull request #302 from kitty624/source-dev
Rework of r9343 - simplyfied some things and removed unnecessary parts
This commit is contained in:
+4
-17
@@ -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<NUM_MERCSTARTINGGEAR_KITS; ++i)
|
||||
{
|
||||
bShow = false;
|
||||
for(int j=INV_START_POS; j<NUM_INV_SLOTS; ++j)
|
||||
{
|
||||
usItem = gMercProfileGear[gbCurrentSoldier][i].inv[j];
|
||||
if(usItem != NONE)
|
||||
if(gMercProfileGear[gbCurrentSoldier][i].inv[j] != NONE)
|
||||
{
|
||||
bShow = true;
|
||||
//shadooow: if any of the item in kit is limited to specific system and this system isn't enabled then disable the whole kit from selection
|
||||
if (((Item[usItem].usLimitedToSystem & FOOD_SYSTEM_FLAG) && !UsingFoodSystem()) || ((Item[usItem].usLimitedToSystem & DISEASE_SYSTEM_FLAG) && !gGameExternalOptions.fDisease))
|
||||
{
|
||||
bShow = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bShow)
|
||||
{
|
||||
ShowButton(giWeaponboxSelectionButton[i]);
|
||||
ShowButton( giWeaponboxSelectionButton[i] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
+3
-2
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
+4
-10
@@ -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
|
||||
@@ -1515,17 +1514,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 +2186,8 @@ BOOLEAN WriteItemStats()
|
||||
FilePrintf(hFile,"\t\t<ProvidesRobotNightVision>%d</ProvidesRobotNightVision>\r\n", Item[cnt].fProvidesRobotNightVision );
|
||||
FilePrintf(hFile,"\t\t<ProvidesRobotLaserBonus>%d</ProvidesRobotLaserBonus>\r\n", Item[cnt].fProvidesRobotLaserBonus );
|
||||
|
||||
FilePrintf(hFile, "\t\t<DiseaseSystemExclusive>%d</DiseaseSystemExclusive>\r\n", Item[cnt].DiseaseSystemExclusive);
|
||||
|
||||
FilePrintf(hFile,"\t</ITEM>\r\n");
|
||||
}
|
||||
FilePrintf(hFile,"</ITEMLIST>\r\n");
|
||||
|
||||
Reference in New Issue
Block a user