Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TacticalAI/AIUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2787,7 +2787,7 @@ INT16 RoamingRange(SOLDIERTYPE *pSoldier, INT32 * pusFromGridNo)
BOOL OppPosKnown = FALSE;
if (CREATURE_OR_BLOODCAT(pSoldier))
{
if (pSoldier->aiData.bAlertStatus == STATUS_BLACK)
if (pSoldier->aiData.bAlertStatus > STATUS_YELLOW)
{
*pusFromGridNo = pSoldier->sGridNo; // from current position!
return(MAX_ROAMING_RANGE);
Expand Down
19 changes: 12 additions & 7 deletions TacticalAI/Movement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,13 +516,18 @@ INT32 InternalGoAsFarAsPossibleTowards(SOLDIERTYPE *pSoldier, INT32 sDesGrid, IN
#ifdef DEBUGDECISIONS
AIPopMessage("destination Grid # itself not valid, looking around it");
#endif
if ( CREATURE_OR_BLOODCAT( pSoldier ) )
{
// we tried to get close, failed; abort!
pSoldier->pathing.usPathIndex = pSoldier->pathing.usPathDataSize = 0;
return( NOWHERE );
}
else
// Commented out this branch for now because bloodcats are constantly failing to find a legal destination in the previous call to legalNPCDestination
// Following the function calls deep enough ( GoAsFarAsPossibleTowards -> InternalGoAsFarAsPossibleTowards -> LegalNPCDestination -> NewOKDestination -> InternalOkayToAddStructureToWorld -> OkayToAddStructureToTile) shows that the last one fails when checking if we can add bloodcat's structure onto the tile our merc is
// This then results them freezing and staying in place even if they can see our mercs
// The reason I'm leaving the code here instead of simply removing it is because this and the check for adding structures to a tile are really old code,
// which has definitely worked fine at some point. As I'm right now unable to find the real reason for this breaking, I'm just circumventing the issue for now. -Asdow
//if ( CREATURE_OR_BLOODCAT( pSoldier ) )
//{
// // we tried to get close, failed; abort!
// pSoldier->pathing.usPathIndex = pSoldier->pathing.usPathDataSize = 0;
// return( NOWHERE );
//}
//else
{
// else look at the 8 nearest gridnos to sDesGrid for a valid destination

Expand Down