Fix invalid edgepoint selection

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8589 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
TheBob
2018-07-28 00:28:31 +00:00
parent 887170dda5
commit 5b9f339f7a
+10 -1
View File
@@ -3356,9 +3356,18 @@ void UpdateMercInSector( SOLDIERTYPE *pSoldier, INT16 sSectorX, INT16 sSectorY,
pSoldier->aiData.bOrders = STATIONARY;
}
if (pSoldier->ubStrategicInsertionCode == INSERTION_CODE_SECONDARY_EDGEINDEX && (
(gubTacticalDirection == NORTH && gus2ndNorthEdgepointArraySize == 0)
|| (gubTacticalDirection == EAST && gus2ndEastEdgepointArraySize == 0)
|| (gubTacticalDirection == SOUTH && gus2ndSouthEdgepointArraySize == 0)
|| (gubTacticalDirection == WEST && gus2ndWestEdgepointArraySize == 0)
))
{
pSoldier->ubStrategicInsertionCode = INSERTION_CODE_PRIMARY_EDGEINDEX;
}
// Use insertion direction from loaded map!
switch ( pSoldier->ubStrategicInsertionCode )
switch (pSoldier->ubStrategicInsertionCode)
{
case INSERTION_CODE_NORTH:
pSoldier->sInsertionGridNo = gMapInformation.sNorthGridNo;