diff options
author | Peter Nelson <peter1138@openttd.org> | 2019-01-26 01:48:40 +0000 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-02-02 21:39:06 +0000 |
commit | 9de12521ecec338160c37920e65fd02c0c742bef (patch) | |
tree | 66f41585907f29ddbe22bb340c34bd23bffa58bd /src/saveload/depot_sl.cpp | |
parent | ea4ea628163c735db4c4714966c9bc1c560e0f61 (diff) | |
download | openttd-9de12521ecec338160c37920e65fd02c0c742bef.tar.xz |
Codechange: Convert saveload numbers to enum values.
(This was mostly achieved with a few in-place regexes)
Diffstat (limited to 'src/saveload/depot_sl.cpp')
-rw-r--r-- | src/saveload/depot_sl.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/saveload/depot_sl.cpp b/src/saveload/depot_sl.cpp index 14a255779..b92417693 100644 --- a/src/saveload/depot_sl.cpp +++ b/src/saveload/depot_sl.cpp @@ -20,13 +20,13 @@ static TownID _town_index; static const SaveLoad _depot_desc[] = { - SLE_CONDVAR(Depot, xy, SLE_FILE_U16 | SLE_VAR_U32, 0, 6), - SLE_CONDVAR(Depot, xy, SLE_UINT32, 6, SL_MAX_VERSION), - SLEG_CONDVAR(_town_index, SLE_UINT16, 0, 141), - SLE_CONDREF(Depot, town, REF_TOWN, 141, SL_MAX_VERSION), - SLE_CONDVAR(Depot, town_cn, SLE_UINT16, 141, SL_MAX_VERSION), - SLE_CONDSTR(Depot, name, SLE_STR, 0, 141, SL_MAX_VERSION), - SLE_CONDVAR(Depot, build_date, SLE_INT32, 142, SL_MAX_VERSION), + SLE_CONDVAR(Depot, xy, SLE_FILE_U16 | SLE_VAR_U32, SL_MIN_VERSION, SLV_6), + SLE_CONDVAR(Depot, xy, SLE_UINT32, SLV_6, SL_MAX_VERSION), + SLEG_CONDVAR(_town_index, SLE_UINT16, SL_MIN_VERSION, SLV_141), + SLE_CONDREF(Depot, town, REF_TOWN, SLV_141, SL_MAX_VERSION), + SLE_CONDVAR(Depot, town_cn, SLE_UINT16, SLV_141, SL_MAX_VERSION), + SLE_CONDSTR(Depot, name, SLE_STR, 0, SLV_141, SL_MAX_VERSION), + SLE_CONDVAR(Depot, build_date, SLE_INT32, SLV_142, SL_MAX_VERSION), SLE_END() }; @@ -49,7 +49,7 @@ static void Load_DEPT() SlObject(depot, _depot_desc); /* Set the town 'pointer' so we can restore it later. */ - if (IsSavegameVersionBefore(141)) depot->town = (Town *)(size_t)_town_index; + if (IsSavegameVersionBefore(SLV_141)) depot->town = (Town *)(size_t)_town_index; } } @@ -59,7 +59,7 @@ static void Ptrs_DEPT() FOR_ALL_DEPOTS(depot) { SlObject(depot, _depot_desc); - if (IsSavegameVersionBefore(141)) depot->town = Town::Get((size_t)depot->town); + if (IsSavegameVersionBefore(SLV_141)) depot->town = Town::Get((size_t)depot->town); } } |