summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorpasky <pasky@openttd.org>2005-03-17 23:12:23 +0000
committerpasky <pasky@openttd.org>2005-03-17 23:12:23 +0000
commitad579912f4be16f7333553d43e3712ea541c2350 (patch)
treeaaf4ba873d4614c178d027e80231afa6dc1f5320 /misc.c
parentcb084f59c2fbd58d38b15cee53d563816fcbf1c7 (diff)
downloadopenttd-ad579912f4be16f7333553d43e3712ea541c2350.tar.xz
(svn r2021) Fix: Enlarge _cur_town_ctr from byte to uint32 so that all the towns are considered when growing them even for big maps, where much more than 256 towns are around; reported by Tomasz Dubiński <uboottd@hydra.polsl.gliwice.pl>. The savegame still saves just the lowest 8 bits but that doesn't hurt so much.
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index f317def5e..ba472e1e9 100644
--- a/misc.c
+++ b/misc.c
@@ -772,6 +772,11 @@ static const SaveLoadGlobVarList _date_desc[] = {
{&_station_tick_ctr, SLE_UINT16, 0, 255},
{&_random_seeds[0][0], SLE_UINT32, 0, 255},
{&_random_seeds[0][1], SLE_UINT32, 0, 255},
+ /* XXX: We save only a portion of the _cur_town_ctr, this should be
+ * fixed in the next revision bump. It does not hurt so much since
+ * it just gives a small single-time penalty to the towns with higher
+ * IDs at the load time. _cur_town_ctr is zeroed in InitializeTowns()
+ * so the higher octets do not interfere at this time. */
{&_cur_town_ctr, SLE_UINT8, 0, 255},
{&_cur_player_tick_index, SLE_FILE_U8 | SLE_VAR_UINT, 0, 255},
{&_next_competitor_start, SLE_FILE_U16 | SLE_VAR_UINT, 0, 255},