diff options
author | truelight <truelight@openttd.org> | 2006-08-22 20:41:26 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2006-08-22 20:41:26 +0000 |
commit | 5fd9aeb12b75a3971e86e5b7d1701115f57fbc12 (patch) | |
tree | c177232d70dec4fb6d7cd2dbac79206e86ee2daa /town_cmd.c | |
parent | 2e0d16026b77d0ef2ed233f16beb25bbaf836941 (diff) | |
download | openttd-5fd9aeb12b75a3971e86e5b7d1701115f57fbc12.tar.xz |
(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.
Diffstat (limited to 'town_cmd.c')
-rw-r--r-- | town_cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/town_cmd.c b/town_cmd.c index 46837cbde..59a9945b2 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -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; } |