From 63ccb36ef3ecd53a503c0e9fea87f0784802af0f Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 17 May 2020 23:31:59 +0200 Subject: Codechange: Use std::string for most of the user-settable custom names. --- src/saveload/station_sl.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/saveload/station_sl.cpp') diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index 1d3612ae3..c4d157c0f 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -62,8 +62,7 @@ void MoveBuoysToWaypoints() TileIndex xy = st->xy; Town *town = st->town; StringID string_id = st->string_id; - char *name = st->name; - st->name = nullptr; + std::string name = st->name; Date build_date = st->build_date; /* TTDPatch could use "buoys with rail station" for rail waypoints */ bool train = st->train_station.tile != INVALID_TILE; @@ -176,7 +175,7 @@ static const SaveLoad _old_station_desc[] = { SLE_CONDNULL(1, SL_MIN_VERSION, SLV_4), ///< alpha_order SLE_VAR(Station, string_id, SLE_STRINGID), - SLE_CONDSTR(Station, name, SLE_STR | SLF_ALLOW_CONTROL, 0, SLV_84, SL_MAX_VERSION), + SLE_CONDSSTR(Station, name, SLE_STR | SLF_ALLOW_CONTROL, SLV_84, SL_MAX_VERSION), SLE_CONDVAR(Station, indtype, SLE_UINT8, SLV_103, SL_MAX_VERSION), SLE_CONDVAR(Station, had_vehicle_of_type, SLE_FILE_U16 | SLE_VAR_U8, SL_MIN_VERSION, SLV_122), SLE_CONDVAR(Station, had_vehicle_of_type, SLE_UINT8, SLV_122, SL_MAX_VERSION), @@ -389,7 +388,7 @@ static const SaveLoad _base_station_desc[] = { SLE_VAR(BaseStation, xy, SLE_UINT32), SLE_REF(BaseStation, town, REF_TOWN), SLE_VAR(BaseStation, string_id, SLE_STRINGID), - SLE_STR(BaseStation, name, SLE_STR | SLF_ALLOW_CONTROL, 0), + SLE_SSTR(BaseStation, name, SLE_STR | SLF_ALLOW_CONTROL), SLE_VAR(BaseStation, delete_ctr, SLE_UINT8), SLE_VAR(BaseStation, owner, SLE_UINT8), SLE_VAR(BaseStation, facilities, SLE_UINT8), -- cgit v1.2.3-70-g09d2