diff options
Diffstat (limited to 'town_cmd.c')
-rw-r--r-- | town_cmd.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/town_cmd.c b/town_cmd.c index dcded352b..94cce70fd 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -952,8 +952,7 @@ static Town *AllocateTown(void) if (!IsValidTown(t)) { TownID index = t->index; - if (t->index > _total_towns) - _total_towns = t->index; + if (t->index >= _total_towns) _total_towns = t->index + 1; memset(t, 0, sizeof(Town)); t->index = index; @@ -1956,8 +1955,7 @@ static void Load_TOWN(void) t = GetTown(index); SlObject(t, _town_desc); - if ((uint)index > _total_towns) - _total_towns = index; + if ((uint)index >= _total_towns) _total_towns = index + 1; } /* This is to ensure all pointers are within the limits of |