Fix AI units to reload/rechamber off-hand when necessary

Fix to prevent soldiers from climbing the wrong building while moving toward a disturbance
Fix to prevent soldiers from doing nothing when a climb point is not nearby
Fix improper indexing of directions

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1533 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Overhaul
2007-10-20 08:19:17 +00:00
parent dd0d6ea66d
commit 035359edf0
7 changed files with 205 additions and 142 deletions
+3 -3
View File
@@ -574,7 +574,7 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN
ubDirChecked[ubDirection] = TRUE;
// determine the gridno 1 tile away from current friend in this direction
sTempDest = NewGridNo(sDesGrid, DirectionInc( ubDirection + 1 ) );
sTempDest = NewGridNo(sDesGrid,DirectionInc( ubDirection ));
// if that's out of bounds, ignore it & check next direction
if (sTempDest == sDesGrid)
@@ -625,8 +625,8 @@ INT16 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT16 sDesGrid, IN
{
// what is the next gridno in the path?
//sTempDest = NewGridNo( sGoToGrid,DirectionInc( (pSoldier->usPathingData[sLoop] + 1) ) );
sTempDest = NewGridNo( sGoToGrid, DirectionInc( pSoldier->usPathingData[sLoop] ) );
//sTempDest = NewGridNo( sGoToGrid,DirectionInc( (INT16) (pSoldier->usPathingData[sLoop] + 1) ) );
sTempDest = NewGridNo( sGoToGrid,DirectionInc( (UINT8) (pSoldier->usPathingData[sLoop]) ) );
//NumMessage("sTempDest = ",sTempDest);
// this should NEVER be out of bounds