mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Fix: militia can retreat to impassable sectors in autoresolve
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8836 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2285,7 +2285,7 @@ void RetreatAllInvolvedMilitiaGroups()
|
||||
// if we haven't found a good direction yet, we have to pick the best adjacent sector we can find
|
||||
if ( !found )
|
||||
{
|
||||
INT32 besttime = 1000000;
|
||||
INT32 besttime = 0xffffffff;
|
||||
UINT8 usDirection = NORTH_STRATEGIC_MOVE;
|
||||
for ( UINT8 i = 0; i < 4; ++i )
|
||||
{
|
||||
@@ -2316,6 +2316,9 @@ void RetreatAllInvolvedMilitiaGroups()
|
||||
if ( loopX < 1 || loopX >= MAP_WORLD_X - 1 || loopY < 1 || loopY >= MAP_WORLD_Y - 1 )
|
||||
continue;
|
||||
|
||||
if ( SectorIsImpassable( SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ), usDirection ) )
|
||||
continue;
|
||||
|
||||
// don't retreat into an occupied sector!
|
||||
if ( NumNonPlayerTeamMembersInSector( loopX, loopY, ENEMY_TEAM ) > 0 )
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user