mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +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 )
|
if( fCalculateDirection )
|
||||||
ubDirection = ubCalculatedDirection;
|
ubDirection = ubCalculatedDirection;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
// Override calculated direction if we were told to....
|
||||||
|
if ( pSoldier->ubInsertionDirection >= 100 )
|
||||||
|
{
|
||||||
|
pSoldier->ubInsertionDirection -= 100;
|
||||||
|
}
|
||||||
ubDirection = pSoldier->ubInsertionDirection;
|
ubDirection = pSoldier->ubInsertionDirection;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user