mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Merged from revision: 7401
Fixes (by Buggler) - Fixed enemies retreating to inaccessible sectors - Fixed hardcoded interrogation sector values git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7402 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -6639,12 +6639,30 @@ void CrippledVersionFailureToLoadMapCallBack( UINT8 bExitValue )
|
|||||||
#endif
|
#endif
|
||||||
BOOLEAN EscapeDirectionIsValid( INT8 * pbDirection )
|
BOOLEAN EscapeDirectionIsValid( INT8 * pbDirection )
|
||||||
{
|
{
|
||||||
|
UINT8 ubSectorID = SECTOR( gWorldSectorX, gWorldSectorY );
|
||||||
|
|
||||||
switch( *pbDirection )
|
switch( *pbDirection )
|
||||||
{
|
{
|
||||||
case NORTHEAST: if( gWorldSectorX + 1 > MAXIMUM_VALID_X_COORDINATE ) *pbDirection = -1; break; // east
|
case NORTHEAST: // east
|
||||||
case SOUTHEAST: if( gWorldSectorY + 1 > MAXIMUM_VALID_Y_COORDINATE ) *pbDirection = -1; break; // south
|
if( gWorldSectorX + 1 > MAXIMUM_VALID_X_COORDINATE || gMapInformation.sEastGridNo == NOWHERE ||
|
||||||
case SOUTHWEST: if( gWorldSectorX - 1 < MINIMUM_VALID_X_COORDINATE ) *pbDirection = -1; break; // west
|
SectorInfo[ ubSectorID ].ubTraversability[ EAST_STRATEGIC_MOVE ] == GROUNDBARRIER || SectorInfo[ ubSectorID ].ubTraversability[ EAST_STRATEGIC_MOVE ] == EDGEOFWORLD )
|
||||||
case NORTHWEST: if( gWorldSectorY - 1 < MINIMUM_VALID_Y_COORDINATE ) *pbDirection = -1; break; // north
|
*pbDirection = -1;
|
||||||
|
break;
|
||||||
|
case SOUTHEAST: // south
|
||||||
|
if( gWorldSectorY + 1 > MAXIMUM_VALID_Y_COORDINATE || gMapInformation.sSouthGridNo == NOWHERE ||
|
||||||
|
SectorInfo[ ubSectorID ].ubTraversability[ SOUTH_STRATEGIC_MOVE ] == GROUNDBARRIER || SectorInfo[ ubSectorID ].ubTraversability[ SOUTH_STRATEGIC_MOVE ] == EDGEOFWORLD )
|
||||||
|
*pbDirection = -1;
|
||||||
|
break;
|
||||||
|
case SOUTHWEST: // west
|
||||||
|
if( gWorldSectorX - 1 < MINIMUM_VALID_X_COORDINATE || gMapInformation.sWestGridNo == NOWHERE ||
|
||||||
|
SectorInfo[ ubSectorID ].ubTraversability[ WEST_STRATEGIC_MOVE ] == GROUNDBARRIER || SectorInfo[ ubSectorID ].ubTraversability[ WEST_STRATEGIC_MOVE ] == EDGEOFWORLD )
|
||||||
|
*pbDirection = -1;
|
||||||
|
break;
|
||||||
|
case NORTHWEST: // north
|
||||||
|
if( gWorldSectorY - 1 < MINIMUM_VALID_Y_COORDINATE || gMapInformation.sNorthGridNo == NOWHERE ||
|
||||||
|
SectorInfo[ ubSectorID ].ubTraversability[ NORTH_STRATEGIC_MOVE ] == GROUNDBARRIER || SectorInfo[ ubSectorID ].ubTraversability[ NORTH_STRATEGIC_MOVE ] == EDGEOFWORLD )
|
||||||
|
*pbDirection = -1;
|
||||||
|
break;
|
||||||
default: *pbDirection = -1;
|
default: *pbDirection = -1;
|
||||||
}
|
}
|
||||||
return( *pbDirection != -1 );
|
return( *pbDirection != -1 );
|
||||||
|
|||||||
@@ -7082,7 +7082,8 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
|
|||||||
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_LOST, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_LOST, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||||
|
|
||||||
// SANDRO - end quest if cleared the sector after interrogation (sector N7 by Meduna)
|
// SANDRO - end quest if cleared the sector after interrogation (sector N7 by Meduna)
|
||||||
if ( gWorldSectorX == 7 && gWorldSectorY == 14 && gbWorldSectorZ == 0 && gubQuest[ QUEST_INTERROGATION ] == QUESTINPROGRESS )
|
if ( gWorldSectorX == gModSettings.ubMeanwhileInterrogatePOWSectorX && gWorldSectorY == gModSettings.ubMeanwhileInterrogatePOWSectorY &&
|
||||||
|
gbWorldSectorZ == 0 && gubQuest[ QUEST_INTERROGATION ] == QUESTINPROGRESS )
|
||||||
{
|
{
|
||||||
// Quest failed
|
// Quest failed
|
||||||
InternalEndQuest( QUEST_INTERROGATION, gWorldSectorX, gWorldSectorY, FALSE );
|
InternalEndQuest( QUEST_INTERROGATION, gWorldSectorX, gWorldSectorY, FALSE );
|
||||||
@@ -7271,7 +7272,8 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
|
|||||||
ShouldBeginAutoBandage( );
|
ShouldBeginAutoBandage( );
|
||||||
}
|
}
|
||||||
// SANDRO - end quest if cleared the sector after interrogation (sector N7 by Meduna)
|
// SANDRO - end quest if cleared the sector after interrogation (sector N7 by Meduna)
|
||||||
if ( gWorldSectorX == 7 && gWorldSectorY == 14 && gbWorldSectorZ == 0 && gubQuest[ QUEST_INTERROGATION ] == QUESTINPROGRESS )
|
if ( gWorldSectorX == gModSettings.ubMeanwhileInterrogatePOWSectorX && gWorldSectorY == gModSettings.ubMeanwhileInterrogatePOWSectorY &&
|
||||||
|
gbWorldSectorZ == 0 && gubQuest[ QUEST_INTERROGATION ] == QUESTINPROGRESS )
|
||||||
{
|
{
|
||||||
// Complete quest
|
// Complete quest
|
||||||
EndQuest( QUEST_INTERROGATION, gWorldSectorX, gWorldSectorY );
|
EndQuest( QUEST_INTERROGATION, gWorldSectorX, gWorldSectorY );
|
||||||
|
|||||||
Reference in New Issue
Block a user