mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Fix for AI seeking climb point in toxic gas
Fix for civilians trying to climb the roof to seek noise Fix for punching and stabbing Transparent change: Gave names to anonymous structs in OBJECTTYPE git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1225 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
#include "worldman.h"
|
||||
#endif
|
||||
|
||||
#include "AIInternals.h"
|
||||
|
||||
#define ROOF_LOCATION_CHANCE 8
|
||||
|
||||
UINT8 gubBuildingInfo[ WORLD_MAX ];
|
||||
@@ -440,7 +442,7 @@ void GenerateBuildings( void )
|
||||
}
|
||||
}
|
||||
|
||||
INT16 FindClosestClimbPoint( INT16 sStartGridNo, INT16 sDesiredGridNo, BOOLEAN fClimbUp )
|
||||
INT16 FindClosestClimbPoint( SOLDIERTYPE *pSoldier, INT16 sStartGridNo, INT16 sDesiredGridNo, BOOLEAN fClimbUp )
|
||||
{
|
||||
BUILDING * pBuilding;
|
||||
UINT8 ubNumClimbSpots;
|
||||
@@ -468,7 +470,8 @@ INT16 FindClosestClimbPoint( INT16 sStartGridNo, INT16 sDesiredGridNo, BOOLEAN f
|
||||
for ( ubLoop = 0; ubLoop < ubNumClimbSpots; ubLoop++ )
|
||||
{
|
||||
if ( (WhoIsThere2( pBuilding->sUpClimbSpots[ ubLoop ], 0 ) == NOBODY)
|
||||
&& (WhoIsThere2( pBuilding->sDownClimbSpots[ ubLoop ], 1 ) == NOBODY) )
|
||||
&& (WhoIsThere2( pBuilding->sDownClimbSpots[ ubLoop ], 1 ) == NOBODY) &&
|
||||
(!pSoldier || !InGas( pSoldier, psClimbSpots[ ubLoop] ) ) )
|
||||
{
|
||||
sDistance = PythSpacesAway( sStartGridNo, psClimbSpots[ ubLoop ] );
|
||||
if (sDistance < sClosestDistance )
|
||||
|
||||
Reference in New Issue
Block a user