More AI logging information.

PanicAI: use correct movement and stealth mode when determining AP needed.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8768 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-03-08 22:39:21 +00:00
parent 5b8f91912f
commit 9e1b5338a6
18 changed files with 190 additions and 47 deletions
+8
View File
@@ -163,6 +163,7 @@ int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT32 sGridNo)
#endif
// must work even for escorted civs, can't just set the flag
DebugAI(AI_MSG_INFO, pSoldier, String("CancelAIAction: could not resume movement"));
CancelAIAction(pSoldier,FORCE);
}
@@ -188,6 +189,7 @@ int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT32 sGridNo)
if (!pSoldier->aiData.bUnderEscort)
{
DebugAI(AI_MSG_INFO, pSoldier, String("CancelAIAction: not under escort"));
CancelAIAction(pSoldier,DONTFORCE); // no need to force this
}
else
@@ -222,6 +224,7 @@ int TryToResumeMovement(SOLDIERTYPE *pSoldier, INT32 sGridNo)
if (ubGottaCancel)
{
// can't get close, gotta abort the movement!
DebugAI(AI_MSG_INFO, pSoldier, String("CancelAIAction: can't get close, abort movement"));
CancelAIAction(pSoldier,FORCE);
// tell the player doing the escorting that civilian has stopped
@@ -754,18 +757,21 @@ void SoldierTriesToContinueAlongPath(SOLDIERTYPE *pSoldier)
if (pSoldier->aiData.bNewSituation == IS_NEW_SITUATION)
{
DebugAI(AI_MSG_INFO, pSoldier, String("CancelAIAction: IS_NEW_SITUATION"));
CancelAIAction(pSoldier,DONTFORCE);
return;
}
if (TileIsOutOfBounds(pSoldier->aiData.usActionData))
{
DebugAI(AI_MSG_INFO, pSoldier, String("CancelAIAction: bad usActionData"));
CancelAIAction(pSoldier,DONTFORCE);
return;
}
if (!NewOKDestination( pSoldier,pSoldier->aiData.usActionData, TRUE, pSoldier->pathing.bLevel ))
{
DebugAI(AI_MSG_INFO, pSoldier, String("CancelAIAction: !NewOKDestination"));
CancelAIAction(pSoldier,DONTFORCE);
return;
}
@@ -801,6 +807,7 @@ void SoldierTriesToContinueAlongPath(SOLDIERTYPE *pSoldier)
}
else
{
DebugAI(AI_MSG_INFO, pSoldier, String("CancelAIAction: !IsActionAffordable"));
CancelAIAction(pSoldier,DONTFORCE);
#ifdef TESTAI
DebugMsg( TOPIC_JA2AI, DBG_LEVEL_3,
@@ -826,6 +833,7 @@ void SoldierTriesToContinueAlongPath(SOLDIERTYPE *pSoldier)
}
else
{
DebugAI(AI_MSG_INFO, pSoldier, String("CancelAIAction: not enough AP"));
CancelAIAction(pSoldier,DONTFORCE);
#ifdef TESTAI
DebugMsg( TOPIC_JA2AI, DBG_LEVEL_3,