mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Convert to SoldierID
This commit is contained in:
@@ -47,7 +47,7 @@ BOOLEAN InitAnimationCache( SoldierID usSoldierID, AnimationSurfaceCacheType *pA
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
void DeleteAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache )
|
||||
void DeleteAnimationCache( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache )
|
||||
{
|
||||
// Allocate entries
|
||||
if ( pAnimCache->usCachedSurfaces!= NULL )
|
||||
@@ -146,7 +146,7 @@ BOOLEAN GetCachedAnimationSurface( UINT16 usSoldierID, AnimationSurfaceCacheType
|
||||
|
||||
|
||||
|
||||
void UnLoadCachedAnimationSurfaces( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache )
|
||||
void UnLoadCachedAnimationSurfaces( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache )
|
||||
{
|
||||
UINT8 cnt;
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ extern UINT32 guiCacheSize;
|
||||
|
||||
BOOLEAN GetCachedAnimationSurface( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache, UINT16 usSurfaceIndex, UINT16 usCurrentAnimation );
|
||||
BOOLEAN InitAnimationCache( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache );
|
||||
void DeleteAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache );
|
||||
void DeleteAnimationCache( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache );
|
||||
void DetermineOptimumAnimationCacheSize( );
|
||||
void UnLoadCachedAnimationSurfaces( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache );
|
||||
void UnLoadCachedAnimationSurfaces( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache );
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2820,9 +2820,10 @@ BOOLEAN SOLDIERTYPE::ChangeSoldierState( UINT16 usNewState, UINT16 usStartingAni
|
||||
// This function reevaluates the stance if the guy sees us!
|
||||
BOOLEAN ReevaluateEnemyStance( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
|
||||
{
|
||||
INT32 cnt, iClosestEnemy = NOBODY;
|
||||
INT32 cnt;
|
||||
SoldierID iClosestEnemy = NOBODY;
|
||||
INT16 sTargetXPos, sTargetYPos;
|
||||
BOOLEAN fReturnVal = FALSE;
|
||||
BOOLEAN fReturnVal = FALSE;
|
||||
INT16 sDist, sClosestDist = 10000;
|
||||
|
||||
// make the chosen one not turn to face us
|
||||
@@ -2875,21 +2876,21 @@ BOOLEAN ReevaluateEnemyStance( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
|
||||
if ( gGameExternalOptions.fNoEnemyAutoReadyWeapon == 0 )
|
||||
{
|
||||
// Change to fire ready animation
|
||||
ConvertGridNoToXY( MercPtrs[iClosestEnemy]->sGridNo, &sTargetXPos, &sTargetYPos );
|
||||
ConvertGridNoToXY( iClosestEnemy->sGridNo, &sTargetXPos, &sTargetYPos );
|
||||
|
||||
pSoldier->flags.fDontChargeReadyAPs = TRUE;
|
||||
|
||||
// Ready weapon
|
||||
fReturnVal = pSoldier->SoldierReadyWeapon( sTargetXPos, sTargetYPos, FALSE, AIDecideHipOrShoulderStance( pSoldier, MercPtrs[iClosestEnemy]->sGridNo ) );
|
||||
fReturnVal = pSoldier->SoldierReadyWeapon( sTargetXPos, sTargetYPos, FALSE, AIDecideHipOrShoulderStance( pSoldier, iClosestEnemy->sGridNo ) );
|
||||
|
||||
return(fReturnVal);
|
||||
}
|
||||
// this makes the soldier to only turn towards our direction, instead of raising his weapon
|
||||
else if ( gGameExternalOptions.fNoEnemyAutoReadyWeapon == 2 )
|
||||
{
|
||||
//ConvertGridNoToXY( MercPtrs[ iClosestEnemy ]->sGridNo, &sTargetXPos, &sTargetYPos );
|
||||
//ConvertGridNoToXY( iClosestEnemy->sGridNo, &sTargetXPos, &sTargetYPos );
|
||||
//sFacingDir = GetDirectionFromXY( sXPos, sYPos, pSoldier );
|
||||
INT16 sFacingDir = GetDirectionToGridNoFromGridNo( pSoldier->sGridNo, MercPtrs[iClosestEnemy]->sGridNo );
|
||||
INT16 sFacingDir = GetDirectionToGridNoFromGridNo( pSoldier->sGridNo, iClosestEnemy->sGridNo );
|
||||
|
||||
if ( sFacingDir != pSoldier->ubDirection )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user