summaryrefslogtreecommitdiff
path: root/src/saveload/waypoint_sl.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2020-01-12 17:23:04 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2020-01-12 19:08:38 +0100
commita4be4514c9206355af120106e00c18eca8b5d75a (patch)
tree09b828bdb5e1164a2a797fe394e685b0aeba0d6e /src/saveload/waypoint_sl.cpp
parent41163331aa882765e528c0e716f6e49cee2411cb (diff)
downloadopenttd-a4be4514c9206355af120106e00c18eca8b5d75a.tar.xz
Fix #7925: Reset temporary saveload data at the start of loading a savegame instead of at the end.
Otherwise temporary data may be passed from an aborted load action to the next load action.
Diffstat (limited to 'src/saveload/waypoint_sl.cpp')
-rw-r--r--src/saveload/waypoint_sl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp
index 0cba4b8d0..5336d247b 100644
--- a/src/saveload/waypoint_sl.cpp
+++ b/src/saveload/waypoint_sl.cpp
@@ -155,6 +155,11 @@ void MoveWaypointsToBaseStations()
UpdateWaypointOrder(&v->current_order);
}
+ ResetOldWaypoints();
+}
+
+void ResetOldWaypoints()
+{
_old_waypoints.clear();
_old_waypoints.shrink_to_fit();
}
@@ -182,7 +187,7 @@ static const SaveLoad _old_waypoint_desc[] = {
static void Load_WAYP()
{
/* Precaution for when loading failed and it didn't get cleared */
- _old_waypoints.clear();
+ ResetOldWaypoints();
int index;