mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
Convert INVTYPE boolean fields to flagmask (#325)
Rearranged fields from largest to smallest to remove alignment padding
This commit is contained in:
@@ -180,7 +180,7 @@ UINT8 GetProperItemCursor( UINT8 ubSoldierID, UINT16 ubItemIndex, INT32 usMapPos
|
||||
//Madd: quick hack to make wirecutter cursor appear when using a knife that can cut through wire
|
||||
// sevenfm: check that not using bayonet attached to the gun
|
||||
//if ( Item[ubItemIndex].wirecutters && IsCuttableWireFenceAtGridNo( sTargetGridNo ) && pSoldier->pathing.bLevel == 0 )
|
||||
if ( Item[ubItemIndex].wirecutters &&
|
||||
if (ItemIsWirecutters(ubItemIndex) &&
|
||||
IsCuttableWireFenceAtGridNo( sTargetGridNo ) &&
|
||||
pSoldier->pathing.bLevel == 0 &&
|
||||
pSoldier->bWeaponMode != WM_ATTACHED_BAYONET)
|
||||
@@ -1281,7 +1281,7 @@ UINT8 HandleNonActivatedTargetCursor( SOLDIERTYPE *pSoldier, INT32 usMapPos , BO
|
||||
|
||||
//CHRISL: We need to only check the second hand if the weapon in the second hand is onehanded
|
||||
// Check for enough ammo...
|
||||
if ( !EnoughAmmo( pSoldier, FALSE, HANDPOS ) || (pSoldier->IsValidSecondHandShotForReloadingPurposes( ) && !Item[pSoldier->inv[SECONDHANDPOS].usItem].twohanded && !EnoughAmmo( pSoldier, FALSE, SECONDHANDPOS) ) )
|
||||
if ( !EnoughAmmo( pSoldier, FALSE, HANDPOS ) || (pSoldier->IsValidSecondHandShotForReloadingPurposes( ) && !ItemIsTwoHanded(pSoldier->inv[SECONDHANDPOS].usItem) && !EnoughAmmo( pSoldier, FALSE, SECONDHANDPOS) ) )
|
||||
{
|
||||
// Check if ANY ammo exists.....
|
||||
if ( FindAmmoToReload( pSoldier, HANDPOS, NO_SLOT ) == NO_SLOT )
|
||||
@@ -2937,14 +2937,14 @@ UINT8 GetActionModeCursor( SOLDIERTYPE *pSoldier )
|
||||
return( TRAJECTORYCURS );
|
||||
}
|
||||
|
||||
if ( pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || ( pSoldier->bWeaponMode == WM_BURST && Item[pSoldier->inv[HANDPOS].usItem].grenadelauncher ) )
|
||||
if ( pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || ( pSoldier->bWeaponMode == WM_BURST && ItemIsGrenadeLauncher(pSoldier->inv[HANDPOS].usItem) ) )
|
||||
{
|
||||
if ( gGameSettings.fOptions [ TOPTION_GL_BURST_CURSOR ] )
|
||||
return( TARGETCURS );
|
||||
else
|
||||
return ( TRAJECTORYCURS );
|
||||
}
|
||||
else if ( pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO || ( pSoldier->bWeaponMode == WM_AUTOFIRE && Item[pSoldier->inv[HANDPOS].usItem].grenadelauncher ) )
|
||||
else if ( pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO || ( pSoldier->bWeaponMode == WM_AUTOFIRE && ItemIsGrenadeLauncher(pSoldier->inv[HANDPOS].usItem) ) )
|
||||
{
|
||||
if ( gGameSettings.fOptions [ TOPTION_GL_BURST_CURSOR ] )
|
||||
return( TARGETCURS );
|
||||
@@ -2976,7 +2976,7 @@ UINT8 GetActionModeCursor( SOLDIERTYPE *pSoldier )
|
||||
|
||||
// Flugente: cursor for constructing/deconstructing
|
||||
// at the moment the gridno is not required in these functions, thus 1 suffices
|
||||
if (!Item[usInHand].wirecutters && (IsStructureConstructItem(usInHand, 1, pSoldier) || IsStructureDeconstructItem(usInHand, 1, pSoldier)))
|
||||
if (!ItemIsWirecutters(usInHand) && (IsStructureConstructItem(usInHand, 1, pSoldier) || IsStructureDeconstructItem(usInHand, 1, pSoldier)))
|
||||
{
|
||||
ubCursor = FORTICURS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user