mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user