summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/afterload.cpp2
-rw-r--r--src/saveload/waypoint_sl.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index 5831479cd..35337866d 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -997,7 +997,7 @@ bool AfterLoadGame()
FOR_ALL_WAYPOINTS(wp) {
if (wp->delete_ctr == 0) {
if (HasBit(_m[wp->xy].m3, 4)) {
- wp->AssignStationSpec(_m[wp->xy].m4 + 1);
+ AllocateSpecToStation(GetCustomStationSpec(STAT_CLASS_WAYP, _m[wp->xy].m4 + 1), wp, true);
}
/* Move ground type bits from m2 to m4. */
diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp
index 75c687c80..e759dc7f8 100644
--- a/src/saveload/waypoint_sl.cpp
+++ b/src/saveload/waypoint_sl.cpp
@@ -25,8 +25,8 @@ void AfterLoadWaypoints()
for (uint i = 0; i < GetNumCustomStations(STAT_CLASS_WAYP); i++) {
const StationSpec *statspec = GetCustomStationSpec(STAT_CLASS_WAYP, i);
- if (statspec != NULL && statspec->grffile->grfid == wp->speclist->grfid && statspec->localidx == wp->speclist->localidx) {
- wp->speclist->spec = statspec;
+ if (statspec != NULL && statspec->grffile->grfid == wp->speclist[1].grfid && statspec->localidx == wp->speclist[1].localidx) {
+ wp->speclist[1].spec = statspec;
break;
}
}
@@ -65,7 +65,7 @@ static void Save_WAYP()
if (wp->num_specs == 0) {
_waypoint_spec.grfid = 0;
} else {
- _waypoint_spec = *wp->speclist;
+ _waypoint_spec = wp->speclist[1];
}
SlSetArrayIndex(wp->index);
@@ -86,9 +86,9 @@ static void Load_WAYP()
SlObject(wp, _waypoint_desc);
if (_waypoint_spec.grfid != 0) {
- wp->num_specs = 1;
- wp->speclist = MallocT<StationSpecList>(1);
- *wp->speclist = _waypoint_spec;
+ wp->num_specs = 2;
+ wp->speclist = CallocT<StationSpecList>(2);
+ wp->speclist[1] = _waypoint_spec;
}
if (CheckSavegameVersion(84)) wp->name = (char *)(size_t)_waypoint_string_id;