mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
- removed compile warnings
- Fix: sometimes, capturing the last enemy did not end combat as it should - code change: POW are no longer considered visible opponents. This avoids the error of incorrect sight counters (a bit similar to dying enemies) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5752 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+21
-24
@@ -5351,15 +5351,15 @@ INT16 ubMinAPCost;
|
||||
// if yes, and we are facing it, jump
|
||||
// if no, go on, nothing to see here
|
||||
// determine direction of our target
|
||||
INT8 targetdirection = GetDirectionToGridNoFromGridNo(pSoldier->sGridNo, sClosestOpponent);
|
||||
UINT8 targetdirection = GetDirectionToGridNoFromGridNo(pSoldier->sGridNo, sClosestOpponent);
|
||||
|
||||
// determine if there is a jumpable window here, in the direction of our target
|
||||
// store old direction for this check
|
||||
INT tmpdirection = pSoldier->ubDirection;
|
||||
UINT8 tmpdirection = pSoldier->ubDirection;
|
||||
pSoldier->ubDirection = targetdirection;
|
||||
|
||||
INT8 windowdirection = DIRECTION_IRRELEVANT;
|
||||
if ( FindWindowJumpDirection(pSoldier, pSoldier->sGridNo, pSoldier->ubDirection, &windowdirection) && targetdirection == windowdirection )
|
||||
if ( FindWindowJumpDirection(pSoldier, pSoldier->sGridNo, pSoldier->ubDirection, &windowdirection) && targetdirection == (UINT8)windowdirection )
|
||||
{
|
||||
pSoldier->ubDirection = tmpdirection;
|
||||
|
||||
@@ -5389,31 +5389,28 @@ INT16 ubMinAPCost;
|
||||
// The situation mentioned above happens...
|
||||
else if ( (targetbLevel != pSoldier->pathing.bLevel) && SameBuilding( pSoldier->sGridNo, targetGridNo ) )
|
||||
{
|
||||
if ( 1 )//gGameExternalOptions.fZombieCanClimb )
|
||||
if (!TileIsOutOfBounds(targetGridNo) )
|
||||
{
|
||||
if (!TileIsOutOfBounds(targetGridNo) )
|
||||
// need to climb AND have enough APs to get there this turn
|
||||
BOOLEAN fUp = TRUE;
|
||||
if (pSoldier->pathing.bLevel > 0 )
|
||||
fUp = FALSE;
|
||||
|
||||
if ( pSoldier->bActionPoints > GetAPsToClimbRoof ( pSoldier, fUp ) )
|
||||
{
|
||||
// need to climb AND have enough APs to get there this turn
|
||||
BOOLEAN fUp = TRUE;
|
||||
if (pSoldier->pathing.bLevel > 0 )
|
||||
fUp = FALSE;
|
||||
pSoldier->aiData.usActionData = targetGridNo;//FindClosestClimbPoint(pSoldier, fUp );
|
||||
|
||||
if ( pSoldier->bActionPoints > GetAPsToClimbRoof ( pSoldier, fUp ) )
|
||||
{
|
||||
pSoldier->aiData.usActionData = targetGridNo;//FindClosestClimbPoint(pSoldier, fUp );
|
||||
|
||||
// Necessary test: can we climb up at this position? It might happen that our target is directly above us, then we'll have to move
|
||||
INT8 newdirection;
|
||||
if ( ( fUp && FindHeigherLevel( pSoldier, pSoldier->sGridNo, pSoldier->ubDirection, &newdirection ) ) || ( !fUp && FindLowerLevel( pSoldier, pSoldier->sGridNo, pSoldier->ubDirection, &newdirection ) ) )
|
||||
{
|
||||
return( AI_ACTION_CLIMB_ROOF );
|
||||
}
|
||||
else
|
||||
{
|
||||
return(AI_ACTION_SEEK_OPPONENT);
|
||||
}
|
||||
// Necessary test: can we climb up at this position? It might happen that our target is directly above us, then we'll have to move
|
||||
INT8 newdirection;
|
||||
if ( ( fUp && FindHeigherLevel( pSoldier, pSoldier->sGridNo, pSoldier->ubDirection, &newdirection ) ) || ( !fUp && FindLowerLevel( pSoldier, pSoldier->sGridNo, pSoldier->ubDirection, &newdirection ) ) )
|
||||
{
|
||||
return( AI_ACTION_CLIMB_ROOF );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return(AI_ACTION_SEEK_OPPONENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user