More functions converted to SoldierID

This commit is contained in:
Asdow
2024-11-17 16:25:12 +02:00
parent 34f0b40f93
commit 274be524e6
12 changed files with 107 additions and 115 deletions
+10 -10
View File
@@ -913,7 +913,7 @@ BOOLEAN DeInitAnimationSystem( )
STRUCTURE_FILE_REF *InternalGetAnimationStructureRef( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState, BOOLEAN fUseAbsolute ) STRUCTURE_FILE_REF *InternalGetAnimationStructureRef( SoldierID usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState, BOOLEAN fUseAbsolute )
{ {
INT8 bStructDataType; INT8 bStructDataType;
@@ -935,26 +935,26 @@ STRUCTURE_FILE_REF *InternalGetAnimationStructureRef( UINT16 usSoldierID, UINT16
if ( ( usAnimState == FALLFORWARD_FROMHIT_STAND || usAnimState == GENERIC_HIT_STAND || if ( ( usAnimState == FALLFORWARD_FROMHIT_STAND || usAnimState == GENERIC_HIT_STAND ||
usAnimState == FALLFORWARD_FROMHIT_CROUCH || usAnimState == STANDING_BURST_HIT ) && !fUseAbsolute ) usAnimState == FALLFORWARD_FROMHIT_CROUCH || usAnimState == STANDING_BURST_HIT ) && !fUseAbsolute )
{ {
return( gAnimStructureDatabase[ MercPtrs[ usSoldierID ]->ubBodyType ][ S_STRUCT ].pStructureFileRef ); return( gAnimStructureDatabase[ usSoldierID->ubBodyType ][ S_STRUCT ].pStructureFileRef );
} }
return( gAnimStructureDatabase[ MercPtrs[ usSoldierID ]->ubBodyType ][ bStructDataType ].pStructureFileRef ); return( gAnimStructureDatabase[ usSoldierID->ubBodyType ][ bStructDataType ].pStructureFileRef );
} }
STRUCTURE_FILE_REF *GetAnimationStructureRef( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState ) STRUCTURE_FILE_REF *GetAnimationStructureRef( SoldierID usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState )
{ {
return( InternalGetAnimationStructureRef( usSoldierID, usSurfaceIndex, usAnimState, FALSE ) ); return( InternalGetAnimationStructureRef( usSoldierID, usSurfaceIndex, usAnimState, FALSE ) );
} }
STRUCTURE_FILE_REF *GetDefaultStructureRef( UINT16 usSoldierID ) STRUCTURE_FILE_REF *GetDefaultStructureRef( SoldierID usSoldierID )
{ {
return( gAnimStructureDatabase[ MercPtrs[ usSoldierID ]->ubBodyType ][ DEFAULT_STRUCT ].pStructureFileRef ); return( gAnimStructureDatabase[ usSoldierID->ubBodyType ][ DEFAULT_STRUCT ].pStructureFileRef );
} }
// Surface mamagement functions // Surface management functions
BOOLEAN LoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState ) BOOLEAN LoadAnimationSurface( SoldierID usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState )
{ {
AuxObjectData *pAuxData; AuxObjectData *pAuxData;
@@ -1075,7 +1075,7 @@ BOOLEAN LoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16
} }
BOOLEAN UnLoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex ) BOOLEAN UnLoadAnimationSurface( SoldierID usSoldierID, UINT16 usSurfaceIndex )
{ {
// Decrement usage flag, only if this soldier has it currently tagged // Decrement usage flag, only if this soldier has it currently tagged
if ( gbAnimUsageHistory[ usSurfaceIndex ][ usSoldierID ] > 0 ) if ( gbAnimUsageHistory[ usSurfaceIndex ][ usSoldierID ] > 0 )
@@ -1120,7 +1120,7 @@ BOOLEAN UnLoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex )
} }
void ClearAnimationSurfacesUsageHistory( UINT16 usSoldierID ) void ClearAnimationSurfacesUsageHistory( SoldierID usSoldierID )
{ {
UINT32 cnt; UINT32 cnt;
+5 -5
View File
@@ -688,16 +688,16 @@ extern AnimationStructureType gAnimStructureDatabase[ TOTALBODYTYPES ][ NUM_STRU
// Functions // Functions
BOOLEAN InitAnimationSystem( ); BOOLEAN InitAnimationSystem( );
BOOLEAN DeInitAnimationSystem( ); BOOLEAN DeInitAnimationSystem( );
BOOLEAN LoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState ); BOOLEAN LoadAnimationSurface( SoldierID usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState );
BOOLEAN UnLoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex ); BOOLEAN UnLoadAnimationSurface( SoldierID usSoldierID, UINT16 usSurfaceIndex );
void ClearAnimationSurfacesUsageHistory( UINT16 usSoldierID ); void ClearAnimationSurfacesUsageHistory( SoldierID usSoldierID );
void DeleteAnimationProfiles( ); void DeleteAnimationProfiles( );
BOOLEAN LoadAnimationProfiles( ); BOOLEAN LoadAnimationProfiles( );
STRUCTURE_FILE_REF *GetAnimationStructureRef( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState ); STRUCTURE_FILE_REF *GetAnimationStructureRef( SoldierID usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState );
STRUCTURE_FILE_REF *GetDefaultStructureRef( UINT16 usSoldierID ); STRUCTURE_FILE_REF *GetDefaultStructureRef( SoldierID usSoldierID );
// Profile data // Profile data
extern ANIM_PROF *gpAnimProfiles; extern ANIM_PROF *gpAnimProfiles;
+1 -1
View File
@@ -390,7 +390,7 @@ INT32 giSMZipperButton = -1;
BOOLEAN gfSwitchPanel = FALSE; BOOLEAN gfSwitchPanel = FALSE;
UINT8 gbNewPanel = SM_PANEL; UINT8 gbNewPanel = SM_PANEL;
UINT16 gubNewPanelParam = 0; SoldierID gubNewPanelParam = NOBODY;
BOOLEAN gfUIStanceDifferent = FALSE; BOOLEAN gfUIStanceDifferent = FALSE;
BOOLEAN gfAllDisabled = FALSE; BOOLEAN gfAllDisabled = FALSE;
+3 -7
View File
@@ -661,10 +661,7 @@ void ShutdownCurrentPanel( )
void SetCurrentTacticalPanelCurrentMerc( SoldierID ubID )
void SetCurrentTacticalPanelCurrentMerc( UINT16 ubID )
{ {
SOLDIERTYPE *pSoldier; SOLDIERTYPE *pSoldier;
@@ -674,7 +671,7 @@ void SetCurrentTacticalPanelCurrentMerc( UINT16 ubID )
if ( gsCurInterfacePanel == SM_PANEL ) if ( gsCurInterfacePanel == SM_PANEL )
{ {
// If we are not of merc bodytype, or am an epc, and going into inv, goto another.... // If we are not of merc bodytype, or am an epc, and going into inv, goto another....
pSoldier = MercPtrs[ ubID ]; pSoldier = ubID;
if ( !IS_MERC_BODY_TYPE( pSoldier ) || AM_AN_EPC( pSoldier ) ) if ( !IS_MERC_BODY_TYPE( pSoldier ) || AM_AN_EPC( pSoldier ) )
{ {
@@ -693,10 +690,9 @@ void SetCurrentTacticalPanelCurrentMerc( UINT16 ubID )
SetTEAMPanelCurrentMerc( gusSelectedSoldier ); SetTEAMPanelCurrentMerc( gusSelectedSoldier );
break; break;
} }
} }
void CreateCurrentTacticalPanelButtons( ) void CreateCurrentTacticalPanelButtons( )
{ {
switch( gsCurInterfacePanel ) switch( gsCurInterfacePanel )
+4 -4
View File
@@ -372,9 +372,9 @@ enum
extern BOOLEAN gfSwitchPanel; extern BOOLEAN gfSwitchPanel;
extern BOOLEAN gfUIStanceDifferent; extern BOOLEAN gfUIStanceDifferent;
extern UINT8 gbNewPanel; extern UINT8 gbNewPanel;
extern UINT16 gubNewPanelParam; extern SoldierID gubNewPanelParam;
extern INT16 gsCurInterfacePanel; extern INT16 gsCurInterfacePanel;
extern UINT32 guiRENDERBUFFER; extern UINT32 guiRENDERBUFFER;
extern UINT32 guiCLOSE; extern UINT32 guiCLOSE;
@@ -465,7 +465,7 @@ BOOLEAN DrawCTHIndicator();
void CreateCurrentTacticalPanelButtons( ); void CreateCurrentTacticalPanelButtons( );
void RemoveCurrentTacticalPanelButtons( ); void RemoveCurrentTacticalPanelButtons( );
void SetCurrentTacticalPanelCurrentMerc( UINT16 ubID ); void SetCurrentTacticalPanelCurrentMerc( SoldierID ubID );
void SetCurrentInterfacePanel( UINT8 ubNewPanel ); void SetCurrentInterfacePanel( UINT8 ubNewPanel );
BOOLEAN IsMercPortraitVisible( UINT16 ubSoldierID ); BOOLEAN IsMercPortraitVisible( UINT16 ubSoldierID );
+12 -12
View File
@@ -5082,7 +5082,7 @@ CHAR8 *GetSceneFilename( )
return( gzLevelFilenames[ gubCurrentScene ] ); return( gzLevelFilenames[ gubCurrentScene ] );
} }
extern BOOLEAN InternalOkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal, INT16 sSoldierID ); extern BOOLEAN InternalOkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal, SoldierID sSoldierID );
// NB if making changes don't forget to update NewOKDestinationAndDirection // NB if making changes don't forget to update NewOKDestinationAndDirection
BOOLEAN NewOKDestination( SOLDIERTYPE * pCurrSoldier, INT32 sGridNo, BOOLEAN fPeopleToo, INT8 bLevel ) BOOLEAN NewOKDestination( SOLDIERTYPE * pCurrSoldier, INT32 sGridNo, BOOLEAN fPeopleToo, INT8 bLevel )
@@ -5482,7 +5482,7 @@ INT32 FindAdjacentGridEx( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 *pubDirect
UINT8 ubWallOrientation; UINT8 ubWallOrientation;
BOOLEAN fCheckGivenGridNo = TRUE; BOOLEAN fCheckGivenGridNo = TRUE;
UINT8 ubTestDirection; UINT8 ubTestDirection;
EXITGRID ExitGrid; EXITGRID ExitGrid;
// Set default direction // Set default direction
if (pubDirection) if (pubDirection)
@@ -5551,7 +5551,7 @@ INT32 FindAdjacentGridEx( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 *pubDirect
{ {
if ( FindSoldier( sGridNo, &usSoldierIndex, &uiMercFlags, FIND_SOLDIER_GRIDNO ) ) if ( FindSoldier( sGridNo, &usSoldierIndex, &uiMercFlags, FIND_SOLDIER_GRIDNO ) )
{ {
SOLDIERTYPE *pTargetSoldier = MercPtrs[usSoldierIndex]; SOLDIERTYPE *pTargetSoldier = usSoldierIndex;
sGridNo = pTargetSoldier->sGridNo; sGridNo = pTargetSoldier->sGridNo;
if (CREATURE_OR_BLOODCAT(pTargetSoldier) || gAnimControl[pTargetSoldier->usAnimState].ubEndHeight == ANIM_PRONE) if (CREATURE_OR_BLOODCAT(pTargetSoldier) || gAnimControl[pTargetSoldier->usAnimState].ubEndHeight == ANIM_PRONE)
{ {
@@ -5874,7 +5874,7 @@ INT32 FindNextToAdjacentGridEx( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 *pub
{ {
if ( FindSoldier( sGridNo, &usSoldierIndex, &uiMercFlags, FIND_SOLDIER_GRIDNO ) ) if ( FindSoldier( sGridNo, &usSoldierIndex, &uiMercFlags, FIND_SOLDIER_GRIDNO ) )
{ {
SOLDIERTYPE *pTargetSoldier = MercPtrs[usSoldierIndex]; SOLDIERTYPE *pTargetSoldier = usSoldierIndex;
sGridNo = pTargetSoldier->sGridNo; sGridNo = pTargetSoldier->sGridNo;
if (CREATURE_OR_BLOODCAT(pTargetSoldier) || gAnimControl[pTargetSoldier->usAnimState].ubEndHeight == ANIM_PRONE) if (CREATURE_OR_BLOODCAT(pTargetSoldier) || gAnimControl[pTargetSoldier->usAnimState].ubEndHeight == ANIM_PRONE)
{ {
@@ -7307,7 +7307,7 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
// HEADROCK HAM B2.8: Now also reveals equipment dropped by militia, if requirement is met. // HEADROCK HAM B2.8: Now also reveals equipment dropped by militia, if requirement is met.
if ( pTeamSoldier->bTeam == ENEMY_TEAM || if ( pTeamSoldier->bTeam == ENEMY_TEAM ||
(gGameExternalOptions.ubMilitiaDropEquipment == 2 && pTeamSoldier->bTeam == MILITIA_TEAM) || (gGameExternalOptions.ubMilitiaDropEquipment == 2 && pTeamSoldier->bTeam == MILITIA_TEAM) ||
(gGameExternalOptions.ubMilitiaDropEquipment == 1 && pTeamSoldier->bTeam == MILITIA_TEAM && Menptr[pTeamSoldier->ubAttackerID].bTeam != OUR_TEAM) ) (gGameExternalOptions.ubMilitiaDropEquipment == 1 && pTeamSoldier->bTeam == MILITIA_TEAM && pTeamSoldier->ubAttackerID->bTeam != OUR_TEAM) )
{ {
//add a flag to the item so when all enemies are killed, we can run through and reveal all the enemies items //add a flag to the item so when all enemies are killed, we can run through and reveal all the enemies items
usItemFlags |= WORLD_ITEM_DROPPED_FROM_ENEMY; usItemFlags |= WORLD_ITEM_DROPPED_FROM_ENEMY;
@@ -7328,7 +7328,7 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ )
// HEADROCK HAM B2.8: Militia will drop items only if allowed. // HEADROCK HAM B2.8: Militia will drop items only if allowed.
if ( !(gGameExternalOptions.ubMilitiaDropEquipment == 0 && pTeamSoldier->bTeam == MILITIA_TEAM) && if ( !(gGameExternalOptions.ubMilitiaDropEquipment == 0 && pTeamSoldier->bTeam == MILITIA_TEAM) &&
!(gGameExternalOptions.ubMilitiaDropEquipment == 1 && pTeamSoldier->bTeam == MILITIA_TEAM && Menptr[pTeamSoldier->ubAttackerID].bTeam == OUR_TEAM) ) !(gGameExternalOptions.ubMilitiaDropEquipment == 1 && pTeamSoldier->bTeam == MILITIA_TEAM && pTeamSoldier->ubAttackerID->bTeam == OUR_TEAM) )
{ {
AddItemToPool( pTeamSoldier->sGridNo, pObj, bVisible, pTeamSoldier->pathing.bLevel, usItemFlags, -1 ); AddItemToPool( pTeamSoldier->sGridNo, pObj, bVisible, pTeamSoldier->pathing.bLevel, usItemFlags, -1 );
} }
@@ -7784,7 +7784,7 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_WON, gWorldSectorX, gWorldSectorY, gbWorldSectorZ ); HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_WON, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
// Change music modes // Change music modes
if ( gfLastMercTalkedAboutKillingID == NOBODY || ( gfLastMercTalkedAboutKillingID != NOBODY && !( MercPtrs[ gfLastMercTalkedAboutKillingID ]->flags.uiStatusFlags & SOLDIER_MONSTER ) ) ) if ( gfLastMercTalkedAboutKillingID == NOBODY || ( gfLastMercTalkedAboutKillingID != NOBODY && !( gfLastMercTalkedAboutKillingID->flags.uiStatusFlags & SOLDIER_MONSTER ) ) )
{ {
#ifdef NEWMUSIC #ifdef NEWMUSIC
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalVictory[gbWorldSectorZ]; GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalVictory[gbWorldSectorZ];
@@ -7798,7 +7798,7 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
if (!is_networked) if (!is_networked)
ShouldBeginAutoBandage( ); ShouldBeginAutoBandage( );
} }
else if ( gfLastMercTalkedAboutKillingID != NOBODY && ( MercPtrs[ gfLastMercTalkedAboutKillingID ]->flags.uiStatusFlags & SOLDIER_MONSTER ) ) else if ( gfLastMercTalkedAboutKillingID != NOBODY && ( gfLastMercTalkedAboutKillingID->flags.uiStatusFlags & SOLDIER_MONSTER ) )
{ {
// OJW - 20081222 - dont auto-bandage if networked // OJW - 20081222 - dont auto-bandage if networked
if (!is_networked) if (!is_networked)
@@ -7820,11 +7820,11 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
{ {
// OK, If we have just finished a battle with creatures........ play killed creature quote... // OK, If we have just finished a battle with creatures........ play killed creature quote...
// //
if ( gfLastMercTalkedAboutKillingID != NOBODY && ( MercPtrs[ gfLastMercTalkedAboutKillingID ]->flags.uiStatusFlags & SOLDIER_MONSTER ) ) if ( gfLastMercTalkedAboutKillingID != NOBODY && ( gfLastMercTalkedAboutKillingID->flags.uiStatusFlags & SOLDIER_MONSTER ) )
{ {
} }
else if ( gfLastMercTalkedAboutKillingID != NOBODY && ( MercPtrs[ gfLastMercTalkedAboutKillingID ]->ubBodyType == BLOODCAT ) ) else if ( gfLastMercTalkedAboutKillingID != NOBODY && ( gfLastMercTalkedAboutKillingID->ubBodyType == BLOODCAT ) )
{ {
SayBattleSoundFromAnyBodyInSector( BATTLE_SOUND_COOL1 ); SayBattleSoundFromAnyBodyInSector( BATTLE_SOUND_COOL1 );
} }
@@ -11529,9 +11529,9 @@ void TeamRestock(UINT8 bTeam)
} }
// are we allowed to steal access this guy's inventory? // are we allowed to steal access this guy's inventory?
BOOLEAN AllowedToStealFromTeamMate( UINT16 ubID, UINT16 ubTargetID ) BOOLEAN AllowedToStealFromTeamMate( SoldierID ubID, SoldierID ubTargetID )
{ {
if ( gGameExternalOptions.fAccessOtherMercInventories && ubID != ubTargetID && MercPtrs[ubID]->bTeam == MercPtrs[ubTargetID]->bTeam && !AM_AN_EPC(MercPtrs[ubTargetID]) && !IsVehicle(MercPtrs[ubTargetID]) ) if ( gGameExternalOptions.fAccessOtherMercInventories && ubID != ubTargetID && ubID->bTeam == ubTargetID->bTeam && !AM_AN_EPC(ubTargetID) && !IsVehicle(ubTargetID) )
return TRUE; return TRUE;
return FALSE; return FALSE;
+1 -1
View File
@@ -369,7 +369,7 @@ void TeamDropAll(UINT8 bTeam, BOOLEAN fForce = FALSE);
void TeamRestock(UINT8 bTeam); void TeamRestock(UINT8 bTeam);
// are we allowed to steal access this guy's inventory? // are we allowed to steal access this guy's inventory?
BOOLEAN AllowedToStealFromTeamMate( UINT16 ubID, UINT16 ubTargetID ); BOOLEAN AllowedToStealFromTeamMate( SoldierID ubID, SoldierID ubTargetID );
// Flugente: is an soldier profile already used? // Flugente: is an soldier profile already used?
BOOLEAN IsProfileInUse(UINT8 usTeam, INT8 aType, UINT16 aNr); BOOLEAN IsProfileInUse(UINT8 usTeam, INT8 aType, UINT16 aNr);
+1 -1
View File
@@ -7672,7 +7672,7 @@ void CommunicateWatchedLoc( UINT16 ubID, INT32 sGridNo, INT8 bLevel, UINT8 ubPoi
void IncrementWatchedLoc( UINT16 ubID, INT32 sGridNo, INT8 bLevel ) void IncrementWatchedLoc( UINT16 ubID, INT32 sGridNo, INT8 bLevel )
{ {
INT8 bPoint; INT8 bPoint;
bPoint = FindWatchedLoc( ubID, sGridNo, bLevel ); bPoint = FindWatchedLoc( ubID, sGridNo, bLevel );
if (bPoint == -1) if (bPoint == -1)
+24 -24
View File
@@ -69,7 +69,7 @@ BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usIte
UINT8 DetermineFlashbangEffect( SOLDIERTYPE *pSoldier, INT8 ubExplosionDir, BOOLEAN fInBuilding); UINT8 DetermineFlashbangEffect( SOLDIERTYPE *pSoldier, INT8 ubExplosionDir, BOOLEAN fInBuilding);
// HEADROCK HAM 5.1: Explosion Fragments launcher // HEADROCK HAM 5.1: Explosion Fragments launcher
void FireFragments( UINT16 ubOwner, INT16 sX, INT16 sY, INT16 sZ, UINT16 usItem, UINT8 ubDirection = DIRECTION_IRRELEVANT ); void FireFragments( SoldierID ubOwner, INT16 sX, INT16 sY, INT16 sZ, UINT16 usItem, UINT8 ubDirection = DIRECTION_IRRELEVANT );
// Flugente: shoot a gun without anyone operating it (used for makeshift traps wih guns) // Flugente: shoot a gun without anyone operating it (used for makeshift traps wih guns)
void FireFragmentsTrapGun( SOLDIERTYPE* pThrower, INT32 gridno, INT16 sZ, OBJECTTYPE* pObj, UINT8 ubDirection = NORTH ); void FireFragmentsTrapGun( SOLDIERTYPE* pThrower, INT32 gridno, INT16 sZ, OBJECTTYPE* pObj, UINT8 ubDirection = NORTH );
@@ -394,16 +394,16 @@ void IgniteExplosion( SoldierID ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32 sGr
void GenerateExplosion( EXPLOSION_PARAMS *pExpParams ) void GenerateExplosion( EXPLOSION_PARAMS *pExpParams )
{ {
EXPLOSIONTYPE *pExplosion; EXPLOSIONTYPE *pExplosion;
UINT32 uiFlags; UINT32 uiFlags;
UINT8 ubOwner; SoldierID ubOwner;
UINT8 ubTypeID; UINT8 ubTypeID;
INT16 sX; INT16 sX;
INT16 sY; INT16 sY;
INT16 sZ; INT16 sZ;
INT32 sGridNo; INT32 sGridNo;
UINT16 usItem; UINT16 usItem;
INT32 iIndex; INT32 iIndex;
INT8 bLevel; INT8 bLevel;
// Assign param values // Assign param values
uiFlags = pExpParams->uiFlags; uiFlags = pExpParams->uiFlags;
@@ -449,17 +449,17 @@ void GenerateExplosion( EXPLOSION_PARAMS *pExpParams )
void GenerateExplosionFromExplosionPointer( EXPLOSIONTYPE *pExplosion ) void GenerateExplosionFromExplosionPointer( EXPLOSIONTYPE *pExplosion )
{ {
UINT32 uiFlags; UINT32 uiFlags;
UINT8 ubOwner; SoldierID ubOwner;
UINT8 ubTypeID; UINT8 ubTypeID;
INT16 sX; INT16 sX;
INT16 sY; INT16 sY;
INT16 sZ; INT16 sZ;
INT32 sGridNo; INT32 sGridNo;
UINT16 usItem; UINT16 usItem;
UINT8 ubTerrainType; UINT8 ubTerrainType;
INT8 bLevel; INT8 bLevel;
INT32 sSoundID; INT32 sSoundID;
ANITILE_PARAMS AniParams; ANITILE_PARAMS AniParams;
@@ -5004,7 +5004,7 @@ BOOLEAN SetOffBombsInGridNo( SoldierID ubID, INT32 sGridNo, BOOLEAN fAllBombs, I
return( fFoundMine ); return( fFoundMine );
} }
void ActivateSwitchInGridNo( UINT16 ubID, INT32 sGridNo ) void ActivateSwitchInGridNo( SoldierID ubID, INT32 sGridNo )
{ {
UINT32 uiWorldBombIndex; UINT32 uiWorldBombIndex;
OBJECTTYPE * pObj; OBJECTTYPE * pObj;
@@ -5430,7 +5430,7 @@ UINT8 DetermineFlashbangEffect( SOLDIERTYPE *pSoldier, INT8 ubExplosionDir, BOOL
// HEADROCK HAM 5.1: This handles launching fragments out of an explosion. The number of fragments is read from // HEADROCK HAM 5.1: This handles launching fragments out of an explosion. The number of fragments is read from
// the Explosives.XML file, and they each have a set amount of damage and range as well. They are currently // the Explosives.XML file, and they each have a set amount of damage and range as well. They are currently
// fired at completely random trajectories. // fired at completely random trajectories.
void FireFragments( UINT16 ubOwner, INT16 sX, INT16 sY, INT16 sZ, UINT16 usItem, UINT8 ubDirection ) void FireFragments( SoldierID ubOwner, INT16 sX, INT16 sY, INT16 sZ, UINT16 usItem, UINT8 ubDirection )
{ {
// WANNE: Disable Fragments in a multiplayer game, because this can lead to crashes when stepping on mines, ... // WANNE: Disable Fragments in a multiplayer game, because this can lead to crashes when stepping on mines, ...
if (is_networked) if (is_networked)
+17 -21
View File
@@ -13,20 +13,17 @@
// Explosion Data // Explosion Data
typedef struct typedef struct
{ {
UINT32 uiFlags; UINT32 uiFlags;
SoldierID ubOwner;
UINT16 ubOwner; INT8 ubTypeID;
INT8 ubTypeID; UINT16 usItem;
INT16 sX; // World X ( optional )
UINT16 usItem; INT16 sY; // World Y ( optional )
INT16 sZ; // World Z ( optional )
INT16 sX; // World X ( optional ) INT32 sGridNo; // World GridNo
INT16 sY; // World Y ( optional ) BOOLEAN fLocate;
INT16 sZ; // World Z ( optional ) INT8 bLevel; // World level
INT32 sGridNo; // World GridNo UINT8 ubUnsed[1];
BOOLEAN fLocate;
INT8 bLevel; // World level
UINT8 ubUnsed[1];
} EXPLOSION_PARAMS; } EXPLOSION_PARAMS;
@@ -34,12 +31,11 @@ typedef struct
typedef struct typedef struct
{ {
EXPLOSION_PARAMS Params; EXPLOSION_PARAMS Params;
BOOLEAN fAllocated; BOOLEAN fAllocated;
INT16 sCurrentFrame; INT16 sCurrentFrame;
INT32 iID; INT32 iID;
INT32 iLightID; INT32 iLightID;
UINT8 ubUnsed[2]; UINT8 ubUnsed[2];
} EXPLOSIONTYPE; } EXPLOSIONTYPE;
@@ -112,7 +108,7 @@ void HandleExplosionWarningAnimations( );
void DecayBombTimers( void ); void DecayBombTimers( void );
void SetOffBombsByFrequency( SoldierID ubID, INT8 bFrequency ); void SetOffBombsByFrequency( SoldierID ubID, INT8 bFrequency );
BOOLEAN SetOffBombsInGridNo( SoldierID ubID, INT32 sGridNo, BOOLEAN fAllBombs, INT8 bLevel ); BOOLEAN SetOffBombsInGridNo( SoldierID ubID, INT32 sGridNo, BOOLEAN fAllBombs, INT8 bLevel );
void ActivateSwitchInGridNo( UINT16 ubID, INT32 sGridNo ); void ActivateSwitchInGridNo( SoldierID ubID, INT32 sGridNo );
void SetOffPanicBombs( UINT16 ubID, INT8 bPanicTrigger ); void SetOffPanicBombs( UINT16 ubID, INT8 bPanicTrigger );
void UpdateExplosionFrame( INT32 iIndex, INT16 sCurrentFrame ); void UpdateExplosionFrame( INT32 iIndex, INT16 sCurrentFrame );
+27 -27
View File
@@ -632,7 +632,7 @@ STRUCTURE * CreateStructureFromDB( DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubT
extern UINT16 gusTempDragBuildSoldierID; extern UINT16 gusTempDragBuildSoldierID;
BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileIndex, INT16 sExclusionID, BOOLEAN fAddingForReal = FALSE, INT16 sSoldierID = NOBODY ) BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileIndex, INT16 sExclusionID, BOOLEAN fAddingForReal = FALSE, SoldierID sSoldierID = NOBODY )
{ {
// Verifies whether a structure is blocked from being added to the map at a particular point // Verifies whether a structure is blocked from being added to the map at a particular point
DB_STRUCTURE * pDBStructure; DB_STRUCTURE * pDBStructure;
@@ -646,15 +646,15 @@ BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
BOOLEAN fIgnorePeople = (BOOLEAN)(sExclusionID == IGNORE_PEOPLE_STRUCTURE_ID); BOOLEAN fIgnorePeople = (BOOLEAN)(sExclusionID == IGNORE_PEOPLE_STRUCTURE_ID);
BOOLEAN fVehicleIgnoreObstacles = (BOOLEAN)(sExclusionID == VEHICLE_IGNORE_OBSTACLES_STRUCTURE_ID); BOOLEAN fVehicleIgnoreObstacles = (BOOLEAN)(sExclusionID == VEHICLE_IGNORE_OBSTACLES_STRUCTURE_ID);
if( gGameExternalOptions.ubCarsRammingMaxStructureArmour && sSoldierID != NOBODY && MercPtrs[ sSoldierID ]->usSoldierFlagMask2 & SOLDIER_RAM_THROUGH_OBSTACLES ) if( gGameExternalOptions.ubCarsRammingMaxStructureArmour && sSoldierID != NOBODY && sSoldierID->usSoldierFlagMask2 & SOLDIER_RAM_THROUGH_OBSTACLES )
{ {
fVehicleIgnoreObstacles = TRUE; fVehicleIgnoreObstacles = TRUE;
} }
else if ( gGameExternalOptions.ubEnemyJeepsRammingMaxStructureArmour && sSoldierID != NOBODY && COMBAT_JEEP( MercPtrs[sSoldierID] ) ) else if ( gGameExternalOptions.ubEnemyJeepsRammingMaxStructureArmour && sSoldierID != NOBODY && COMBAT_JEEP( sSoldierID ) )
{ {
fVehicleIgnoreObstacles = TRUE; fVehicleIgnoreObstacles = TRUE;
} }
else if ( gGameExternalOptions.ubTanksRammingMaxStructureArmour && sSoldierID != NOBODY && TANK( MercPtrs[sSoldierID] ) ) else if ( gGameExternalOptions.ubTanksRammingMaxStructureArmour && sSoldierID != NOBODY && TANK( sSoldierID ) )
{ {
fVehicleIgnoreObstacles = TRUE; fVehicleIgnoreObstacles = TRUE;
} }
@@ -736,25 +736,25 @@ BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
// but not monsters and such (they can't fall down due to lack of animations) // but not monsters and such (they can't fall down due to lack of animations)
// also make sure AI won't flatten their allies // also make sure AI won't flatten their allies
if( !( pSoldier->flags.uiStatusFlags & ( SOLDIER_VEHICLE | SOLDIER_ROBOT | SOLDIER_MONSTER ) ) && if( !( pSoldier->flags.uiStatusFlags & ( SOLDIER_VEHICLE | SOLDIER_ROBOT | SOLDIER_MONSTER ) ) &&
((!ARMED_VEHICLE( MercPtrs[sSoldierID] ) && gGameExternalOptions.fAllowCarsDrivingOverPeople) || ((!ARMED_VEHICLE( sSoldierID ) && gGameExternalOptions.fAllowCarsDrivingOverPeople) ||
(ARMED_VEHICLE( MercPtrs[sSoldierID] ) && gGameExternalOptions.fAllowTanksDrivingOverPeople)) && (ARMED_VEHICLE( sSoldierID ) && gGameExternalOptions.fAllowTanksDrivingOverPeople)) &&
( MercPtrs[ sSoldierID ]->bTeam == gbPlayerNum || MercPtrs[ sSoldierID ]->bTeam != pSoldier->bTeam ) ) ( sSoldierID->bTeam == gbPlayerNum || sSoldierID->bTeam != pSoldier->bTeam ) )
{ {
pExistingStructure = pExistingStructure->pNext; pExistingStructure = pExistingStructure->pNext;
// damage people when driving on them // damage people when driving on them
if( fAddingForReal ) if( fAddingForReal )
{ {
if ( TANK( MercPtrs[sSoldierID] ) ) if ( TANK( sSoldierID ) )
{ {
pSoldier->EVENT_SoldierGotHit( 0, Random(10)+5, Random(200)+Random(200), MercPtrs[ sSoldierID ]->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo ); pSoldier->EVENT_SoldierGotHit( 0, Random(10)+5, Random(200)+Random(200), sSoldierID->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo );
} }
else if( gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE && MercPtrs[ sSoldierID ]->IsFastMovement() ) else if( gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE && sSoldierID->IsFastMovement() )
{ {
pSoldier->EVENT_SoldierGotHit( 0, Random(5), Random(100)+Random(100), MercPtrs[ sSoldierID ]->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo ); pSoldier->EVENT_SoldierGotHit( 0, Random(5), Random(100)+Random(100), sSoldierID->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo );
} }
else else
{ {
pSoldier->EVENT_SoldierGotHit( 0, Random(10)+5, Random(200)+Random(200), MercPtrs[ sSoldierID ]->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo ); pSoldier->EVENT_SoldierGotHit( 0, Random(10)+5, Random(200)+Random(200), sSoldierID->ubDirection, 0, sSoldierID, FIRE_WEAPON_VEHICLE_TRAUMA, 0, 0, pSoldier->sGridNo );
} }
} }
continue; continue;
@@ -770,9 +770,9 @@ BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
else else
{ {
// only if structure is weak enough // only if structure is weak enough
if ( (!ARMED_VEHICLE( MercPtrs[sSoldierID] ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubCarsRammingMaxStructureArmour) || if ( (!ARMED_VEHICLE( sSoldierID ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubCarsRammingMaxStructureArmour) ||
(COMBAT_JEEP( MercPtrs[sSoldierID] ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubEnemyJeepsRammingMaxStructureArmour) || (COMBAT_JEEP( sSoldierID ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubEnemyJeepsRammingMaxStructureArmour) ||
(TANK( MercPtrs[sSoldierID] ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubTanksRammingMaxStructureArmour) ) (TANK( sSoldierID ) && gubMaterialArmour[pExistingStructure->pDBStructureRef->pDBStructure->ubArmour] < gGameExternalOptions.ubTanksRammingMaxStructureArmour) )
{ {
// when not just plotting path, really destroy structure // when not just plotting path, really destroy structure
if( fAddingForReal ) if( fAddingForReal )
@@ -911,7 +911,7 @@ BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
{ {
if( MercPtrs[ pExistingStructure->usStructureID ] != NULL && MercPtrs[ pExistingStructure->usStructureID ]->flags.uiStatusFlags & SOLDIER_VEHICLE ) if( MercPtrs[ pExistingStructure->usStructureID ] != NULL && MercPtrs[ pExistingStructure->usStructureID ]->flags.uiStatusFlags & SOLDIER_VEHICLE )
{ {
if( MercPtrs[ sSoldierID ]->flags.fInNonintAnim == TRUE || gAnimControl[ MercPtrs[ sSoldierID ]->usAnimState ].ubEndHeight == ANIM_PRONE ) if( sSoldierID->flags.fInNonintAnim == TRUE || gAnimControl[ sSoldierID->usAnimState ].ubEndHeight == ANIM_PRONE )
{ {
pExistingStructure = pExistingStructure->pNext; pExistingStructure = pExistingStructure->pNext;
continue; continue;
@@ -958,7 +958,7 @@ BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUC
return( TRUE ); return( TRUE );
} }
BOOLEAN InternalOkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal, INT16 sSoldierID ) BOOLEAN InternalOkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal, SoldierID sSoldierID )
{ {
UINT8 ubLoop; UINT8 ubLoop;
INT16 sCubeOffset; INT16 sCubeOffset;
@@ -1001,7 +1001,7 @@ BOOLEAN InternalOkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_ST
return( TRUE ); return( TRUE );
} }
BOOLEAN OkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal, INT16 sSoldierID ) BOOLEAN OkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal, SoldierID sSoldierID )
{ {
return( InternalOkayToAddStructureToWorld( sBaseGridNo, bLevel, pDBStructureRef, sExclusionID, fAddingForReal, sSoldierID ) ); return( InternalOkayToAddStructureToWorld( sBaseGridNo, bLevel, pDBStructureRef, sExclusionID, fAddingForReal, sSoldierID ) );
} }
@@ -1036,15 +1036,15 @@ BOOLEAN AddStructureToTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure, U
STRUCTURE * InternalAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, LEVELNODE * pLevelNode ) STRUCTURE * InternalAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, LEVELNODE * pLevelNode )
{ {
// Adds a complete structure to the world at a location plus all other locations covered by the structure // Adds a complete structure to the world at a location plus all other locations covered by the structure
INT32 sGridNo; INT32 sGridNo;
STRUCTURE ** ppStructure; STRUCTURE **ppStructure;
STRUCTURE * pBaseStructure; STRUCTURE *pBaseStructure;
DB_STRUCTURE * pDBStructure; DB_STRUCTURE *pDBStructure;
DB_STRUCTURE_TILE ** ppTile; DB_STRUCTURE_TILE **ppTile;
UINT8 ubLoop; UINT8 ubLoop;
UINT8 ubLoop2; UINT8 ubLoop2;
INT16 sBaseTileHeight=-1; INT16 sBaseTileHeight=-1;
UINT16 usStructureID; UINT16 usStructureID;
CHECKF( pDBStructureRef ); CHECKF( pDBStructureRef );
CHECKF( pLevelNode ); CHECKF( pLevelNode );
+1 -1
View File
@@ -37,7 +37,7 @@ BOOLEAN FreeStructureFile( STRUCTURE_FILE_REF * pStructureFile );
// //
// functions at the structure instance level // functions at the structure instance level
// //
BOOLEAN OkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal = FALSE, INT16 sSoldierID = NOBODY ); BOOLEAN OkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, INT16 sExclusionID, BOOLEAN fAddingForReal = FALSE, SoldierID sSoldierID = NOBODY );
// for the PTR argument of AddStructureToWorld, pass in a LEVELNODE * please! // for the PTR argument of AddStructureToWorld, pass in a LEVELNODE * please!
BOOLEAN AddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, PTR pLevelN ); BOOLEAN AddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, PTR pLevelN );