summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-02-16 21:43:44 +0000
committersmatz <smatz@openttd.org>2009-02-16 21:43:44 +0000
commitb9b14bd803cd827b7ece4e3e63bb10472badeecb (patch)
treeea16bdce9f4760e716818fdabfce075d35fde2f8 /src/saveload
parent2f767e77e86d9dabae12786c98901fd01bedd853 (diff)
downloadopenttd-b9b14bd803cd827b7ece4e3e63bb10472badeecb.tar.xz
(svn r15500) -Fix (r12648): pre-0.5 OTTD stored new_nonstop and full_load_any in a different way, savegame conversion wasn't working for them
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/order_sl.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/saveload/order_sl.cpp b/src/saveload/order_sl.cpp
index ef11056ed..0ec506f1d 100644
--- a/src/saveload/order_sl.cpp
+++ b/src/saveload/order_sl.cpp
@@ -14,8 +14,8 @@ void Order::ConvertFromOldSavegame()
uint8 old_flags = this->flags;
this->flags = 0;
- /* First handle non-stop */
- if (_settings_client.gui.sg_new_nonstop) {
+ /* First handle non-stop - use value from savegame if possible, else use value from config file */
+ if (_settings_client.gui.sg_new_nonstop || (CheckSavegameVersion(22) && _settings_client.gui.new_nonstop)) {
/* OFB_NON_STOP */
this->SetNonStopType((old_flags & 8) ? ONSF_NO_STOP_AT_ANY_STATION : ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
} else {
@@ -35,7 +35,8 @@ void Order::ConvertFromOldSavegame()
} else if ((old_flags & 4) == 0) { // !OFB_FULL_LOAD
this->SetLoadType(OLF_LOAD_IF_POSSIBLE);
} else {
- this->SetLoadType(_settings_client.gui.sg_full_load_any ? OLF_FULL_LOAD_ANY : OLFB_FULL_LOAD);
+ /* old OTTD versions stored full_load_any in config file - assume it was enabled when loading */
+ this->SetLoadType(_settings_client.gui.sg_full_load_any || CheckSavegameVersion(22) ? OLF_FULL_LOAD_ANY : OLFB_FULL_LOAD);
}
/* Finally fix the unload flags */