mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
Convert INVTYPE boolean fields to flagmask (#325)
Rearranged fields from largest to smallest to remove alignment padding
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user