diff --git a/TileEngine/Buildings.h b/TileEngine/Buildings.h index b23c0887..aad46b8b 100644 --- a/TileEngine/Buildings.h +++ b/TileEngine/Buildings.h @@ -6,11 +6,11 @@ // for what it's worth, 2 bytes, we use roof climb spots as 1-based // so the 0th entry is always 0 and can be compared with (and not equal) // NOWHERE or any other location -#define MAX_CLIMBSPOTS_PER_BUILDING 21 +#define MAX_CLIMBSPOTS_PER_BUILDING 255 // similarly for buildings, only we really want 0 to be invalid index #define NO_BUILDING 0 -#define MAX_BUILDINGS 31 +#define MAX_BUILDINGS 255 typedef struct BUILDING { diff --git a/TileEngine/SaveLoadMap.cpp b/TileEngine/SaveLoadMap.cpp index ac74c050..afcce698 100644 --- a/TileEngine/SaveLoadMap.cpp +++ b/TileEngine/SaveLoadMap.cpp @@ -28,8 +28,9 @@ extern BOOLEAN gfLoadingExitGrids; BOOLEAN gfApplyChangesToTempFile = FALSE; -// There are 3200 bytes, and each bit represents the revelaed status. -// 3200 bytes * 8 bits = 25600 map elements +// There are 3200 bytes, and each bit represents the revealed status. +// 3200 bytes * 8 bits = 25600 map elements +// BIGMAPS has now a theoretical limit of 2000 * 2000 = 4,000,000 map elements; 500k bytes UINT8 *gpRevealedMap; #ifdef JA2UB @@ -924,7 +925,7 @@ BOOLEAN LoadRevealedStatusArrayFromRevealedTempFile() void SetSectorsRevealedBit( UINT32 usMapIndex ) { - UINT16 usByteNumber; + UINT32 usByteNumber; UINT8 ubBitNumber; usByteNumber = usMapIndex / 8; @@ -948,7 +949,7 @@ void SetMapRevealedStatus() ClearSlantRoofs( ); //Loop through all bytes in the array - for( usByteCnt=0; usByteCnt< 3200; usByteCnt++) + for( usByteCnt=0; usByteCnt< (UINT32) NUM_REVEALED_BYTES; usByteCnt++) { //loop through all the bits in the byte for( ubBitCnt=0; ubBitCnt<8; ubBitCnt++)