Fix: incorrect path rebuilding in RebuildWayPointsForGroupPath(), incorrect GroupAtFinalDestination() detection (by sun_alf)

*  RebuildWayPointsForGroupPath(): incorrect manipulations with 'iOldDelta' and 'iDelta' lead to skipping a node in 'pHeadOfPath' and to assertion failure as a result:
   AssertMsg( FALSE, String( "Invalid DIAGONAL waypoint being added for groupID %d. AM-0", pGroup->ubGroupID ) );
* GroupAtFinalDestination(): should take into account the amount of WayPoints, otherwise multiple visiting of a sector is not possible (group end up in that sector at first entrance):
   if( ( pGroup->ubSectorX == wp->x ) && ( pGroup->ubSectorY == wp->y ) )

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9348 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
rftr
2022-03-26 21:00:13 +00:00
parent 90850826bb
commit bd5b14358d
4 changed files with 51 additions and 33 deletions
+2 -1
View File
@@ -74,9 +74,10 @@ extern BOOLEAN gfUseAlternateMap;
#define CHECK_DIR_Y_DELTA ( WORLD_TILE_Y * 10 )
// get index into aray
#define CALCULATE_STRATEGIC_INDEX( x, y ) ( x + ( y * MAP_WORLD_X ) )
#define CALCULATE_STRATEGIC_INDEX( x, y ) ( x + ( y * MAP_WORLD_X ) )
#define GET_X_FROM_STRATEGIC_INDEX( i ) ( i % MAP_WORLD_X )
#define GET_Y_FROM_STRATEGIC_INDEX( i ) ( i / MAP_WORLD_X )
#define INVALID_STRATEGIC_INDEX ( 0 )
// macros to convert between the 2 different sector numbering systems
#define SECTOR_INFO_TO_STRATEGIC_INDEX( i ) ( CALCULATE_STRATEGIC_INDEX ( SECTORX( i ), SECTORY( i ) ) )