From ac91cfb731b0560625f760e80c5f27b9c57315be Mon Sep 17 00:00:00 2001 From: Lesh Date: Wed, 8 Nov 2006 17:04:15 +0000 Subject: [PATCH] - fixed CTD when trying to add 13th town - preparations to increase number of town sectors git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@623 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Map Screen Interface Map.cpp | 4 ++-- Strategic/Map Screen Interface Map.h | 4 ++-- Strategic/Strategic Town Loyalty.cpp | 4 ++-- Strategic/mapscreen.h | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Strategic/Map Screen Interface Map.cpp b/Strategic/Map Screen Interface Map.cpp index 26fa31af..c934d058 100644 --- a/Strategic/Map Screen Interface Map.cpp +++ b/Strategic/Map Screen Interface Map.cpp @@ -378,7 +378,7 @@ UINT32 guiMapBorderHeliSectors; BOOLEAN sBadSectorsList[ WORLD_MAP_X ][ WORLD_MAP_X ]; -INT16 sBaseSectorList[12];/*={ +INT16 sBaseSectorList[ MAX_TOWNS - 1 ];/*={ // NOTE: These co-ordinates must match the top left corner of the 3x3 town tiles cutouts in Interface/MilitiaMaps.sti! SECTOR( 9, 1 ), // Omerta SECTOR( 13, 2 ), // Drassen @@ -396,7 +396,7 @@ INT16 sBaseSectorList[12];/*={ // position of town names on the map // these are no longer PIXELS, but 10 * the X,Y position in SECTORS (fractions possible) to the X-CENTER of the town -POINT pTownPoints[13];/*={ +POINT pTownPoints[ MAX_TOWNS ];/*={ { 0 , 0 }, { 90, 10}, // Omerta {125, 40}, // Drassen diff --git a/Strategic/Map Screen Interface Map.h b/Strategic/Map Screen Interface Map.h index cd91f90d..642e25cf 100644 --- a/Strategic/Map Screen Interface Map.h +++ b/Strategic/Map Screen Interface Map.h @@ -285,7 +285,7 @@ extern BOOLEAN fFoundTixa; extern UINT32 guiSubLevel1, guiSubLevel2, guiSubLevel3; -extern INT16 sBaseSectorList[12]; -extern POINT pTownPoints[13]; +extern INT16 sBaseSectorList[ MAX_TOWNS - 1 ]; +extern POINT pTownPoints[ MAX_TOWNS ]; #endif \ No newline at end of file diff --git a/Strategic/Strategic Town Loyalty.cpp b/Strategic/Strategic Town Loyalty.cpp index d07a9c1c..3e45ee6a 100644 --- a/Strategic/Strategic Town Loyalty.cpp +++ b/Strategic/Strategic Town Loyalty.cpp @@ -106,8 +106,8 @@ TOWN_LOYALTY gTownLoyalty[ MAX_TOWNS ]; // town name and locations arrays, for town theft and what not -INT32 pTownNamesList[ 40 ]; -INT32 pTownLocationsList[ 40 ]; +INT32 pTownNamesList [ MAX_TOWN_SECTORS ]; +INT32 pTownLocationsList [ MAX_TOWN_SECTORS ]; INT32 iTownDistances[ MAX_TOWNS ][ MAX_TOWNS ]; diff --git a/Strategic/mapscreen.h b/Strategic/mapscreen.h index 3d20c50e..e681270e 100644 --- a/Strategic/mapscreen.h +++ b/Strategic/mapscreen.h @@ -10,7 +10,8 @@ #define MAX_TOWN_NAME_LENGHT 32 -#define MAX_TOWNS 13 +#define MAX_TOWNS 13 +#define MAX_TOWN_SECTORS 40 // Sector name identifiers enum Towns