Skip to content

Commit

Permalink
Convert INVTYPE boolean fields to flagmask (1dot13#325)
Browse files Browse the repository at this point in the history
Rearranged fields from largest to smallest to remove alignment padding
  • Loading branch information
Asdow authored Aug 22, 2024
1 parent ce02a48 commit 49a119e
Show file tree
Hide file tree
Showing 59 changed files with 1,425 additions and 1,324 deletions.
4 changes: 2 additions & 2 deletions Editor/EditorItems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void EntryInitEditorItemsInfo()
item = &Item[i];
//if( Item[i].fFlags & ITEM_NOT_EDITOR )
// continue;
if(item->notineditor)
if(ItemIsNotInEditor(i))
continue;
if( i == SWITCH || i == ACTION_ITEM )
{
Expand Down Expand Up @@ -331,7 +331,7 @@ void InitEditorItemsInfo(UINT32 uiItemType)
continue;
}
item = &Item[usCounter];
if(item->notineditor)
if(ItemIsNotInEditor(usCounter))
{
usCounter++;
continue;
Expand Down
22 changes: 11 additions & 11 deletions Laptop/BobbyRGuns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1765,11 +1765,11 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
{
if ( iSubFilter > -1 ) // Madd: new BR filters
{
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter )
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter )
bAddItem = TRUE;
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
bAddItem = TRUE;
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment)
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
bAddItem = TRUE;
}
else
Expand Down Expand Up @@ -2653,11 +2653,11 @@ void SetFirstLastPagesForNew( UINT32 uiClassMask, INT32 iFilter, INT32 iSubFilte
{
if (iSubFilter > -1 )
{
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & iSubFilter)
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & iSubFilter)
bCntNumItems = TRUE;
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
else if (iSubFilter == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
bCntNumItems = TRUE;
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment )
else if (iSubFilter == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
bCntNumItems = TRUE;
}
else
Expand Down Expand Up @@ -3641,11 +3641,11 @@ void CalcFirstIndexForPage( STORE_INVENTORY *pInv, UINT32 uiItemClass )
{
if (guiCurrentMiscSubFilterMode > -1) // Madd: new BR filter options
{
if (Item[usItemIndex].attachment && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode)
if (ItemIsAttachment(usItemIndex) && Item[usItemIndex].attachmentclass & guiCurrentMiscSubFilterMode)
bCntItem = TRUE;
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && Item[usItemIndex].attachment)
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_OTHER_ATTACHMENTS && !(Item[usItemIndex].attachmentclass & BR_MISC_FILTER_STD_ATTACHMENTS) && ItemIsAttachment(usItemIndex))
bCntItem = TRUE;
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !Item[usItemIndex].attachment)
else if (guiCurrentMiscSubFilterMode == BR_MISC_FILTER_NO_ATTACHMENTS && !ItemIsAttachment(usItemIndex))
bCntItem = TRUE;
}
else
Expand Down Expand Up @@ -4181,7 +4181,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
for (it = range.first; it != range.second; it++)
{
UINT16 attachmentId = it->second.attachmentIndex;
if (!Item[attachmentId].hiddenaddon && !Item[attachmentId].hiddenattachment && ItemIsLegal(attachmentId, TRUE))
if (!ItemIsHiddenAddon(attachmentId) && !ItemIsHiddenAttachment(attachmentId) && ItemIsLegal(attachmentId, TRUE))
{
fAttachmentsFound = TRUE;
if (DecorateAppendString(attachStr3, ATTACHMENTS_STRBUF_SIZE, Item[attachmentId].szItemName) == FALSE)
Expand All @@ -4194,7 +4194,7 @@ void GetHelpTextForItemInLaptop( STR16 pzStr, UINT16 usItemNumber )
for (UINT32 itemId = 1; itemId < gMAXITEMS_READ; itemId++)
{
// If the attachment is not hidden and attachable to the gun (usItemNumber)
if (!Item[itemId].hiddenaddon && !Item[itemId].hiddenattachment &&
if (!ItemIsHiddenAddon(itemId) && !ItemIsHiddenAttachment(itemId) &&
ItemIsLegal(itemId, TRUE) && IsAttachmentPointAvailable(Item[usItemNumber].uiIndex, itemId))
{
fAttachmentsFound = TRUE;
Expand Down
10 changes: 5 additions & 5 deletions Laptop/IMP Confirm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ void DistributeInitialGear(MERCPROFILESTRUCT *pProfile)
if(iOrder[i]!=-1)
{
// skip if this item is an attachment
if(Item[tInv[iOrder[i]].inv].attachment)
if(ItemIsAttachment(tInv[iOrder[i]].inv))
continue;
iSet = FALSE;
number = tInv[iOrder[i]].iNumber;
Expand Down Expand Up @@ -1103,7 +1103,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
return HELMETPOS;
if ( pProfile->inv[VESTPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_VEST )
return VESTPOS;
if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !(Item[usItem].attachment))
if ( pProfile->inv[LEGPOS] == NONE && Armour[Item[usItem].ubClassIndex].ubArmourClass == ARMOURCLASS_LEGGINGS && !ItemIsAttachment(usItem) )
return LEGPOS;
break;
case IC_BLADE:
Expand Down Expand Up @@ -1132,7 +1132,7 @@ INT32 SpecificFreePocket(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 ubHow
case IC_GUN:
if ( pProfile->inv[HANDPOS] == NONE )
return HANDPOS;
if ( pProfile->inv[SECONDHANDPOS] == NONE && !(Item[pProfile->inv[HANDPOS]].twohanded))
if ( pProfile->inv[SECONDHANDPOS] == NONE && !(ItemIsTwoHanded(pProfile->inv[HANDPOS])))
return SECONDHANDPOS;
if((UsingNewInventorySystem() == true))
if ( pProfile->inv[GUNSLINGPOCKPOS] == NONE && pProfile->inv[BPACKPOCKPOS] == NONE && LBEPocketType[1].ItemCapacityPerSize[Item[usItem].ItemSize]!=0)
Expand Down Expand Up @@ -1681,7 +1681,7 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )

// give ammo for guns
Assert( usItem < gMAXITEMS_READ );
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
{
usItem = DefaultMagazine(usItem);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPRandomItems: give ammo typeIndex = %d, usItem = %d ",typeIndex, usItem ));
Expand Down Expand Up @@ -1726,7 +1726,7 @@ void GiveIMPItems( MERCPROFILESTRUCT *pProfile, INT8 abilityValue, UINT8 typeInd
MakeProfileInvItemAnySlot(pProfile,usItem,100,1);

// give ammo for guns
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
if ( Item[usItem].usItemClass == IC_GUN && !ItemIsRocketLauncher(usItem) )
{
usItem = DefaultMagazine(usItem);
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("GiveIMPItems: give ammo typeIndex = %d, usItem = %d",typeIndex, usItem ));
Expand Down
2 changes: 1 addition & 1 deletion Laptop/IMP Gear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ void DistributePossibleItemsToVectors(void)
{
gIMPPossibleItems[HANDPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));

if (Item[usItem].twohanded) {
if (ItemIsTwoHanded(usItem)) {
gIMPPossibleItems[GUNSLINGPOCKPOS].push_back(std::make_pair(usItem, Item[usItem].szItemName));
}
else {
Expand Down
4 changes: 2 additions & 2 deletions Strategic/ASD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ void EnemyHeliMANPADSCheck( INT16 id )
if ( pObj )
{
// abort if this is a launcher without ammo
if ( Item[pObj->usItem].rocketlauncher && !Item[pObj->usItem].singleshotrocketlauncher )
if (ItemIsRocketLauncher(pObj->usItem) && !ItemIsSingleShotRocketLauncher(pObj->usItem))
{
OBJECTTYPE* pAttachment = FindAttachmentByClass( pObj, IC_GRENADE );
if ( !pAttachment->exists( ) )
Expand Down Expand Up @@ -1227,7 +1227,7 @@ void EnemyHeliMANPADSCheck( INT16 id )
MapScreenMessage( FONT_MCOLOR_LTRED, MSG_INTERFACE, szEnemyHeliText[7], pSoldier->GetName( ), Item[pObj->usItem].szItemName, pStrSectorName );

// 'fire' (remove shot)
if ( Item[pObj->usItem].singleshotrocketlauncher )
if (ItemIsSingleShotRocketLauncher(pObj->usItem))
{
CreateItem( Item[pObj->usItem].discardedlauncheritem, (*pObj)[0]->data.objectStatus, pObj );

Expand Down
22 changes: 11 additions & 11 deletions Strategic/Assignments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3349,7 +3349,7 @@ UINT8 CalculateRepairPointsForRepairman(SOLDIERTYPE *pSoldier, UINT16 *pusMaxPts
}

// can't repair at all without a toolkit
if (!Item[pSoldier->inv[HANDPOS].usItem].toolkit )
if (!ItemIsToolkit(pSoldier->inv[HANDPOS].usItem))
{
*pusMaxPts = 0;
return(0);
Expand Down Expand Up @@ -4063,7 +4063,7 @@ UINT16 ToolKitPoints(SOLDIERTYPE *pSoldier)
// CHRISL: Changed to dynamically determine max inventory locations.
for (int ubPocket=HANDPOS; ubPocket < NUM_INV_SLOTS; ++ubPocket)
{
if( Item[pSoldier->inv[ ubPocket ].usItem].toolkit )
if(ItemIsToolkit(pSoldier->inv[ ubPocket ].usItem))
{
usKitpts += TotalPoints( &( pSoldier->inv[ ubPocket ] ) );
}
Expand Down Expand Up @@ -5138,7 +5138,7 @@ void DoActualRepair( SOLDIERTYPE * pSoldier, UINT16 usItem, INT16 * pbStatus, IN

// repairs on electronic items take twice as long if the guy doesn't have the skill
// Technician/Electronic traits - repairing electronic items - SANDRO
if ( Item[ usItem ].electronic )
if (ItemIsElectronic(usItem))
{
if (gGameOptions.fNewTraitSystem)
{
Expand Down Expand Up @@ -5745,7 +5745,7 @@ void HandleRepairBySoldier( SOLDIERTYPE *pSoldier )
BOOLEAN IsItemRepairable(SOLDIERTYPE* pSoldier, UINT16 usItem, INT16 bStatus, INT16 bThreshold )
{
// check to see if item can/needs to be repaired
if ( ( bStatus < 100) && ( Item[ usItem ].repairable ) )
if ( ( bStatus < 100) && ItemIsRepairable(usItem) )
{
if ( gGameExternalOptions.fAdvRepairSystem )
{
Expand Down Expand Up @@ -10459,7 +10459,7 @@ BOOLEAN MakeSureToolKitIsInHand( SOLDIERTYPE *pSoldier )
INT8 bPocket = 0, bonus = -101, bToolkitPocket = NO_SLOT;

// if there isn't a toolkit in his hand
if( Item[pSoldier->inv[ HANDPOS].usItem].toolkit )
if(ItemIsToolkit(pSoldier->inv[ HANDPOS].usItem))
{
bonus = Item[pSoldier->inv[ HANDPOS].usItem].RepairModifier;
bToolkitPocket = HANDPOS;
Expand All @@ -10469,7 +10469,7 @@ BOOLEAN MakeSureToolKitIsInHand( SOLDIERTYPE *pSoldier )
// CHRISL: Changed to dynamically determine max inventory locations.
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
{
if( Item[pSoldier->inv[ bPocket ].usItem].toolkit && Item[pSoldier->inv[ bPocket ].usItem].RepairModifier > bonus)
if(ItemIsToolkit(pSoldier->inv[ bPocket ].usItem) && Item[pSoldier->inv[ bPocket ].usItem].RepairModifier > bonus)
{
bonus = Item[pSoldier->inv[ bPocket ].usItem].RepairModifier;
bToolkitPocket = bPocket;
Expand Down Expand Up @@ -10503,15 +10503,15 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
fTeamPanelDirty = TRUE;

// if there is a MEDICAL BAG in his hand, we're set
if ( Item[pSoldier->inv[ HANDPOS ].usItem].medicalkit )
if (ItemIsMedicalKit(pSoldier->inv[ HANDPOS ].usItem))
{
return(TRUE);
}

// run through rest of inventory looking 1st for MEDICAL BAGS, swap the first one into hand if found
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
{
if ( Item[pSoldier->inv[ bPocket ].usItem].medicalkit )
if (ItemIsMedicalKit(pSoldier->inv[ bPocket ].usItem))
{
medkit_found = true;
can_swap = true;
Expand Down Expand Up @@ -10579,7 +10579,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
return FALSE;

// we didn't find a medical bag, so settle for a FIRST AID KIT
if ( Item[pSoldier->inv[ HANDPOS ].usItem].firstaidkit )
if (ItemIsFirstAidKit(pSoldier->inv[ HANDPOS ].usItem))
{
return(TRUE);
}
Expand All @@ -10588,10 +10588,10 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier , bool bAllow1stAidKit)
// CHRISL: Changed to dynamically determine max inventory locations.
for (bPocket = SECONDHANDPOS; bPocket < NUM_INV_SLOTS; ++bPocket)
{
if ( Item[pSoldier->inv[ bPocket ].usItem].firstaidkit )
if (ItemIsFirstAidKit(pSoldier->inv[ bPocket ].usItem))
{
// CHRISL: This needs to start with the first "non-big" pocket.
if( ( Item[ pSoldier -> inv[ HANDPOS ].usItem ].twohanded ) && ( bPocket >= SMALLPOCKSTART ) )
if( (ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem) && (bPocket >= SMALLPOCKSTART)))
{
// first move from hand to second hand
SwapObjs( pSoldier, HANDPOS, SECONDHANDPOS, TRUE );
Expand Down
4 changes: 2 additions & 2 deletions Strategic/Auto Resolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4257,7 +4257,7 @@ BOOLEAN FireTankCannon( SOLDIERCELL *pAttacker )
{
pItem = &pSoldier->inv[i];

if ( Item[pItem->usItem].cannon )
if (ItemIsCannon(pItem->usItem))
{
PlayAutoResolveSample( Weapon[pItem->usItem].sSound, RATE_11025, 50, 1, MIDDLEPAN );

Expand Down Expand Up @@ -4291,7 +4291,7 @@ BOOLEAN FireAntiTankWeapon( SOLDIERCELL *pAttacker )
{
pItem = &pSoldier->inv[i];

if ( Item[pItem->usItem].usItemClass == IC_LAUNCHER || Item[pItem->usItem].cannon )
if ( Item[pItem->usItem].usItemClass == IC_LAUNCHER || ItemIsCannon(pItem->usItem))
{
pAttacker->bWeaponSlot = (INT8)i;
if ( gpAR->fUnlimitedAmmo )
Expand Down
2 changes: 1 addition & 1 deletion Strategic/Hourly Update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ void HourlySmokerUpdate( )
INT8 invsize = (INT8)pSoldier->inv.size( ); // remember inventorysize, so we don't call size() repeatedly
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop ) // ... for all items in our inventory ...
{
if ( pSoldier->inv[bLoop].exists( ) && Item[pSoldier->inv[bLoop].usItem].cigarette )
if ( pSoldier->inv[bLoop].exists( ) && ItemIsCigarette(pSoldier->inv[bLoop].usItem) )
{
pObj = &(pSoldier->inv[bLoop]);

Expand Down
6 changes: 3 additions & 3 deletions Strategic/Map Screen Interface Map Inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
}
else
{
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[twItem->object.usItem].usItemClass == IC_GUN && (twItem->object)[0]->data.gun.ubGunShotsLeft && !(Item[twItem->object.usItem].singleshotrocketlauncher))
if ( _KeyDown(SHIFT) && gpItemPointer == NULL && Item[twItem->object.usItem].usItemClass == IC_GUN && (twItem->object)[0]->data.gun.ubGunShotsLeft && !ItemIsSingleShotRocketLauncher(twItem->object.usItem))
{
EmptyWeaponMagazine( &twItem->object, &gItemPointer );
InternalMAPBeginItemPointer( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
Expand Down Expand Up @@ -6009,15 +6009,15 @@ void HandleItemCooldownFunctions( OBJECTTYPE* itemStack, INT32 deltaSeconds, BOO

//original code by flugente, renamed variables to fit here, removed "min (OVERHEATING_MAX_TEMPERATURE, newValue)" for dirt to allow to go beyond maximum and deduct later the same amount if neccessary.
// ... if we use overheating and item is a gun, a launcher or a barrel ...
if ( gGameExternalOptions.fWeaponOverheating && ( Item[itemStack->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[itemStack->usItem].barrel == TRUE ) )
if ( gGameExternalOptions.fWeaponOverheating && ( Item[itemStack->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || ItemIsBarrel(itemStack->usItem) ) )
{
for(INT16 i = 0; i < itemStack->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ...
{
FLOAT guntemperature = (*itemStack)[i]->data.bTemperature; // ... get temperature ...

FLOAT cooldownfactor = GetItemCooldownFactor(itemStack); // ... get item cooldown factor provided of attachments ...

if ( Item[itemStack->usItem].barrel == TRUE ) // ... a barrel lying around cools down a bit faster ...
if (ItemIsBarrel(itemStack->usItem)) // ... a barrel lying around cools down a bit faster ...
cooldownfactor *= gGameExternalOptions.iCooldownModificatorLonelyBarrel;

FLOAT newguntemperature = max(0.0f, guntemperature - tickspassed * cooldownfactor ); // ... calculate new temperature ...
Expand Down
12 changes: 6 additions & 6 deletions Strategic/Rebel Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4417,16 +4417,16 @@ void SetupInfo()
// (Item[i].usItemClass & IC_AMMO) && (Magazine[ Item[i].ubClassIndex ].ubMagType == AMMO_BOX or AMMO_CRATE?)
for (UINT16 i = 0; i < MAXITEMS; ++i)
{
if (Item[i].gascan) ItemIdCache::gasCans.push_back(i);
else if (Item[i].firstaidkit) ItemIdCache::firstAidKits.push_back(i);
else if (Item[i].medicalkit) ItemIdCache::medKits.push_back(i);
else if (Item[i].toolkit) ItemIdCache::toolKits.push_back(i);
if (ItemIsGascan(i)) ItemIdCache::gasCans.push_back(i);
else if (ItemIsFirstAidKit(i)) ItemIdCache::firstAidKits.push_back(i);
else if (ItemIsMedicalKit(i)) ItemIdCache::medKits.push_back(i);
else if (ItemIsToolkit(i)) ItemIdCache::toolKits.push_back(i);
else if (Item[i].usItemClass & IC_AMMO)
{
if (Magazine[Item[i].ubClassIndex].ubMagType == AMMO_BOX)
{
if ((gGameOptions.fGunNut || !Item[i].biggunlist)
&& (gGameOptions.ubGameStyle == STYLE_SCIFI || !Item[i].scifi))
if ((gGameOptions.fGunNut || !ItemIsOnlyInTonsOfGuns(i))
&& (gGameOptions.ubGameStyle == STYLE_SCIFI || !ItemIsOnlyInScifi(i)))
{
// coolness runs from 1-10, so apply offset
const UINT8 coolness = min(max(1, Item[i].ubCoolness), 10);
Expand Down
2 changes: 1 addition & 1 deletion Strategic/Strategic Event Handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ void CheckForMissingHospitalSupplies( void )
}
}
#endif//obsoleteCode
if ( Item[pObj->usItem].firstaidkit || Item[pObj->usItem].medicalkit || pObj->usItem == REGEN_BOOSTER || pObj->usItem == ADRENALINE_BOOSTER )
if (ItemIsFirstAidKit(pObj->usItem) || ItemIsMedicalKit(pObj->usItem) || pObj->usItem == REGEN_BOOSTER || pObj->usItem == ADRENALINE_BOOSTER )
{
for (StackedObjects::iterator iter = pObj->objectStack.begin(); iter != pObj->objectStack.end(); ++iter) {
if ( iter->data.objectStatus > 60 )
Expand Down
2 changes: 1 addition & 1 deletion Strategic/Strategic Movement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5137,7 +5137,7 @@ void AddFuelToVehicle( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVehicle )
OBJECTTYPE *pItem;
INT16 sFuelNeeded, sFuelAvailable, sFuelAdded;
pItem = &pSoldier->inv[ HANDPOS ];
if( !Item[pItem->usItem].gascan )
if( !ItemIsGascan(pItem->usItem))
{
#ifdef JA2BETAVERSION
CHAR16 str[ 100 ];
Expand Down
Loading

0 comments on commit 49a119e

Please sign in to comment.