Convert INVTYPE boolean fields to flagmask (#325)

Rearranged fields from largest to smallest to remove alignment padding
This commit is contained in:
Asdow
2024-08-22 08:48:29 +03:00
committed by GitHub
parent ce02a488f0
commit 49a119e6b9
59 changed files with 1437 additions and 1336 deletions
+5 -4
View File
@@ -460,7 +460,7 @@ INVTYPE* GearGetRandomFaceItem(INT8 min_coolness = -1, INT8 max_coolness = -1, U
if (HasItemFlag((*it)->uiIndex, SCUBA_MASK))
continue;
if (item_type == FACEITEM_GAS_MASK && (*it)->gasmask < 1) continue;
if (item_type == FACEITEM_GAS_MASK && !ItemIsGasmask((*it)->uiIndex)) continue;
if (item_type == FACEITEM_SPECTACLES && (*it)->brightlightvisionrangebonus < 1) continue;
if (item_type == FACEITEM_NVG && (*it)->nightvisionrangebonus < 1) continue;
if (item_type == FACEITEM_HEADSET && (*it)->hearingrangebonus < 1) continue;
@@ -643,7 +643,8 @@ std::vector<INVTYPE*> GearFindAttachmentsForWeapon(INVTYPE* weapon, BOOL attach_
{
INVTYPE* item = *it;
if (item->attachment < 1)
//if (item->attachment < 1)
if (!ItemIsAttachment(item->uiIndex))
continue;
if (!ValidAttachment(item->uiIndex, weapon->uiIndex))
@@ -680,7 +681,7 @@ std::vector<INVTYPE*> GearFindItemsForRole(std::vector<UINT8>* roles, std::vecto
INVTYPE* item = *it;
INT8 chance = 0;
if (item->glgrenade > 0)
if (ItemIsGLgrenade(item->uiIndex))
continue;
if (item->attachmentclass == AC_GRENADE || item->attachmentclass == AC_ROCKET)
@@ -1061,4 +1062,4 @@ void RandomizeMerc(UINT8 profile_id, MERCPROFILESTRUCT* merc, BOOL random_gear_k
merc->usOptionalGearCost = kit_cost;
}
}
}
}