Hopefully improved AI code: don't try to resume movement after ActionDone was executed.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8911 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-10-26 17:37:44 +00:00
parent 3f2fd185e6
commit 80554bcde8
+7 -1
View File
@@ -782,6 +782,12 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier ) // FIXME - this function is named
} }
//*** TRICK- TAKE INTO ACCOUNT PAUSED FOR NO TIME ( FOR NOW ) //*** TRICK- TAKE INTO ACCOUNT PAUSED FOR NO TIME ( FOR NOW )
// sevenfm: check if we still have where to go and what to do
if (pSoldier->aiData.bAction != AI_ACTION_NONE &&
pSoldier->aiData.bNewSituation != IS_NEW_SITUATION &&
!TileIsOutOfBounds(pSoldier->aiData.usActionData) &&
NewOKDestination(pSoldier, pSoldier->aiData.usActionData, TRUE, pSoldier->pathing.bLevel))
{
if (pSoldier->flags.fNoAPToFinishMove) if (pSoldier->flags.fNoAPToFinishMove)
{ {
SoldierTriesToContinueAlongPath(pSoldier); SoldierTriesToContinueAlongPath(pSoldier);
@@ -805,12 +811,12 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier ) // FIXME - this function is named
#ifdef TESTAI #ifdef TESTAI
DebugMsg( TOPIC_JA2AI, DBG_LEVEL_0, String("GONNA TRY TO CONTINUE PATH FOR %d", pSoldier->ubID ) ); DebugMsg( TOPIC_JA2AI, DBG_LEVEL_0, String("GONNA TRY TO CONTINUE PATH FOR %d", pSoldier->ubID ) );
#endif #endif
SoldierTriesToContinueAlongPath(pSoldier); SoldierTriesToContinueAlongPath(pSoldier);
} }
} }
} }
} }
}
else if (pSoldier->aiData.bAction == AI_ACTION_CLIMB_ROOF && !pSoldier->aiData.bActionInProgress) else if (pSoldier->aiData.bAction == AI_ACTION_CLIMB_ROOF && !pSoldier->aiData.bActionInProgress)
{ {
ActionDone(pSoldier); ActionDone(pSoldier);