New option AUTO_HIDE_PB (TRUE) enables auto hiding of the progress bar when mouse cursor is on the top map row.

AI soldiers will now avoid staying at top map row.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8723 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-01-05 08:20:42 +00:00
parent 58308434f7
commit f10590587a
8 changed files with 104 additions and 18 deletions
+31
View File
@@ -1032,6 +1032,12 @@ INT32 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
continue;
}
// sevenfm: avoid staying at north edge
if (NorthSpot(sGridNo, pSoldier->pathing.bLevel))
{
continue;
}
iPathCost = gubAIPathCosts[AI_PATHCOST_RADIUS + sXOffset][AI_PATHCOST_RADIUS + sYOffset];
/*
// water is OK, if the only good hiding place requires us to get wet, OK
@@ -1475,6 +1481,13 @@ INT32 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
if ( InLightAtNight( sGridNo, pSoldier->pathing.bLevel ) )
continue;
// sevenfm: avoid staying at north edge
if (!gGameExternalOptions.fAITacticalRetreat &&
NorthSpot(sGridNo, pSoldier->pathing.bLevel))
{
continue;
}
// OK, this place shows potential. How useful is it as cover?
//NumMessage("Promising seems gridno #",gridno);
@@ -1615,6 +1628,12 @@ INT32 FindNearestUngassedLand(SOLDIERTYPE *pSoldier)
continue;
}
// sevenfm: avoid staying at north edge
if (NorthSpot(sGridNo, pSoldier->pathing.bLevel))
{
continue;
}
// CJC: here, unfortunately, we must calculate a path so we have an AP cost
// obviously, we're looking for LAND, so water is out!
@@ -1728,6 +1747,12 @@ INT32 FindNearbyDarkerSpot( SOLDIERTYPE *pSoldier )
continue;
}
// sevenfm: avoid staying at north edge
if (NorthSpot(sGridNo, pSoldier->pathing.bLevel))
{
continue;
}
// require this character to stay within their roam range
if ( PythSpacesAway( sOrigin, sGridNo ) > iRoamRange )
{
@@ -2663,6 +2688,12 @@ INT32 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT32 sPos, INT8 bAction )
continue;
}
// sevenfm: avoid staying at north edge
if (NorthSpot(sGridNo, pSoldier->pathing.bLevel))
{
continue;
}
// sevenfm: penalize locations near fresh corpses
if( GetNearestRottingCorpseAIWarning( sGridNo ) > 0 )
{