summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-05-05 23:21:49 +0000
committerglx <glx@openttd.org>2007-05-05 23:21:49 +0000
commit41bbc5c990ffc57cebe6d0f928527ed7fddfa9e9 (patch)
treedc43325663d79d4ee8f57e7190857994a968493c /src
parent74bf87dd82b536b4e25f1948ebf016bc917edd2b (diff)
downloadopenttd-41bbc5c990ffc57cebe6d0f928527ed7fddfa9e9.tar.xz
(svn r9791) -Fix (r9779, FS#766): add TownLayoutByte to correctly save town layout value
Diffstat (limited to 'src')
-rw-r--r--src/openttd.h5
-rw-r--r--src/variables.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/openttd.h b/src/openttd.h
index 529cf66d6..34c0af9d0 100644
--- a/src/openttd.h
+++ b/src/openttd.h
@@ -212,6 +212,11 @@ enum TownLayout {
NUM_TLS, ///< Number of town layouts
};
+/* It needs to be 8bits, because we save and load it as such */
+/** Define basic enum properties */
+template <> struct EnumPropsT<TownLayout> : MakeEnumPropsT<TownLayout, byte, TL_NO_ROADS, NUM_TLS, NUM_TLS> {};
+typedef TinyEnumT<TownLayout> TownLayoutByte; //typedefing-enumification of TownLayout
+
enum {
NUM_PRICES = 49,
};
diff --git a/src/variables.h b/src/variables.h
index 2c32aa7a7..302ba4bb8 100644
--- a/src/variables.h
+++ b/src/variables.h
@@ -232,7 +232,7 @@ struct Patches {
bool pause_on_newgame; ///< Whether to start new games paused or not.
- TownLayout town_layout; ///< Select town layout
+ TownLayoutByte town_layout; ///< Select town layout
};
VARDEF Patches _patches;