(svn r6055) -Codechange: added GetXXXArraySize, which returns HighestID + 1 (or, will do that).

It isn't the best name, but we couldn't find any better.
  This unifies the pool-system even more.
This commit is contained in:
truelight
2006-08-22 20:41:26 +00:00
parent 2e0d16026b
commit 5fd9aeb12b
18 changed files with 94 additions and 34 deletions

View File

@@ -405,12 +405,12 @@ void OnTick_Town(void)
/* Make sure each town's tickhandler invocation frequency is about the
* same - TOWN_GROWTH_FREQUENCY - independent on the number of towns. */
for (_cur_town_iter += GetTownPoolSize();
for (_cur_town_iter += GetTownArraySize();
_cur_town_iter >= TOWN_GROWTH_FREQUENCY;
_cur_town_iter -= TOWN_GROWTH_FREQUENCY) {
uint32 i = _cur_town_ctr;
if (++_cur_town_ctr >= GetTownPoolSize())
if (++_cur_town_ctr >= GetTownArraySize())
_cur_town_ctr = 0;
if (IsValidTownID(i)) TownTickHandler(GetTown(i));
@@ -1964,7 +1964,7 @@ static void Load_TOWN(void)
/* This is to ensure all pointers are within the limits of
* the size of the TownPool */
if (_cur_town_ctr >= GetTownPoolSize())
if (_cur_town_ctr >= GetTownArraySize())
_cur_town_ctr = 0;
}