Fix bloodcat ambush endless loop (#343)

Some bloodcats during ambushes could have ubInsertionDirection with values > 100, which then causes endless looping in pathfinding algorithms as valid direction values range from 0 to 7
This commit is contained in:
Asdow
2024-12-05 16:13:09 +02:00
committed by GitHub
parent 11bb0f741f
commit 1eff9f6aaa
+7
View File
@@ -1201,7 +1201,14 @@ BOOLEAN InternalAddSoldierToSector( UINT8 ubID, BOOLEAN fCalculateDirection, BOO
if( fCalculateDirection )
ubDirection = ubCalculatedDirection;
else
{
// Override calculated direction if we were told to....
if ( pSoldier->ubInsertionDirection >= 100 )
{
pSoldier->ubInsertionDirection -= 100;
}
ubDirection = pSoldier->ubInsertionDirection;
}
}
else
{