mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
-removed lighted spots from valid locations to move to for flanking, finding cover and running away
-moved the running out of lighted areas code to after the main Red AI - this will prevent enemies from running into and back out of lighted areas; however, it might also mean that they end up running straight through the light sometimes -enabled AI to fire at opponents seen by other AIs on Expert & Insane git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@262 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -914,14 +914,16 @@ INT16 FindBestNearbyCover(SOLDIERTYPE *pSoldier, INT32 morale, INT32 *piPercentB
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !fHasGasMask )
|
||||
if ( InGas( pSoldier, sGridNo ) )
|
||||
{
|
||||
if ( InGas( pSoldier, sGridNo ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
//Madd: skip cover in light
|
||||
if ( InLightAtNight( sGridNo, pSoldier->bLevel ) )
|
||||
continue;
|
||||
|
||||
|
||||
// ignore blacklisted spot
|
||||
if ( sGridNo == pSoldier->sBlackList )
|
||||
{
|
||||
@@ -1322,14 +1324,6 @@ INT16 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !fHasGasMask )
|
||||
{
|
||||
if ( InGas( pSoldier, sGridNo ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ( pSoldier->bTeam == CIV_TEAM )
|
||||
{
|
||||
iRoamRange = RoamingRange( pSoldier, &sOrigin );
|
||||
@@ -1345,6 +1339,10 @@ INT16 FindSpotMaxDistFromOpponents(SOLDIERTYPE *pSoldier)
|
||||
continue;
|
||||
}
|
||||
|
||||
//Madd: skip lighted spots
|
||||
if ( InLightAtNight( sGridNo, pSoldier->bLevel ) )
|
||||
continue;
|
||||
|
||||
// OK, this place shows potential. How useful is it as cover?
|
||||
//NumMessage("Promising seems gridno #",gridno);
|
||||
|
||||
@@ -2535,20 +2533,16 @@ INT16 FindFlankingSpot(SOLDIERTYPE *pSoldier, INT16 sPos, INT8 bAction )
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !fHasGasMask )
|
||||
{
|
||||
if ( InGas( pSoldier, sGridNo ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// exclude locations with tear/mustard gas (at this point, smoke is cool!)
|
||||
if ( InGas( pSoldier, sGridNo ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//Madd: skip lighted spots
|
||||
if ( InLightAtNight( sGridNo, pSoldier->bLevel ) )
|
||||
continue;
|
||||
|
||||
// allow an extra direction for flanking
|
||||
if ( bAction == AI_ACTION_FLANK_LEFT )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user