summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/saveload/economy_sl.cpp4
-rw-r--r--src/saveload/engine_sl.cpp2
-rw-r--r--src/saveload/saveload.cpp6
-rw-r--r--src/saveload/saveload.h1
-rw-r--r--src/saveload/station_sl.cpp2
-rw-r--r--src/saveload/strings_sl.cpp2
-rw-r--r--src/saveload/waypoint_sl.cpp2
-rw-r--r--src/settings.cpp2
8 files changed, 11 insertions, 10 deletions
diff --git a/src/saveload/economy_sl.cpp b/src/saveload/economy_sl.cpp
index 7a0f536b2..d8624f5d6 100644
--- a/src/saveload/economy_sl.cpp
+++ b/src/saveload/economy_sl.cpp
@@ -100,8 +100,8 @@ static void Ptrs_CAPY()
static const ChunkHandler economy_chunk_handlers[] = {
{ 'CAPY', Save_CAPY, Load_CAPY, Ptrs_CAPY, nullptr, CH_ARRAY },
- { 'PRIC', nullptr, Load_PRIC, nullptr, nullptr, CH_RIFF },
- { 'CAPR', nullptr, Load_CAPR, nullptr, nullptr, CH_RIFF },
+ { 'PRIC', nullptr, Load_PRIC, nullptr, nullptr, CH_READONLY },
+ { 'CAPR', nullptr, Load_CAPR, nullptr, nullptr, CH_READONLY },
{ 'ECMY', Save_ECMY, Load_ECMY, nullptr, nullptr, CH_ARRAY },
};
diff --git a/src/saveload/engine_sl.cpp b/src/saveload/engine_sl.cpp
index 336c93282..12670449e 100644
--- a/src/saveload/engine_sl.cpp
+++ b/src/saveload/engine_sl.cpp
@@ -196,7 +196,7 @@ static void Load_EIDS()
static const ChunkHandler engine_chunk_handlers[] = {
{ 'EIDS', Save_EIDS, Load_EIDS, nullptr, nullptr, CH_ARRAY },
{ 'ENGN', Save_ENGN, Load_ENGN, nullptr, nullptr, CH_ARRAY },
- { 'ENGS', nullptr, Load_ENGS, nullptr, nullptr, CH_RIFF },
+ { 'ENGS', nullptr, Load_ENGS, nullptr, nullptr, CH_READONLY },
};
extern const ChunkHandlerTable _engine_chunk_handlers(engine_chunk_handlers);
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 9b177dd0d..2184ef85b 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -1897,10 +1897,10 @@ static void SlLoadCheckChunk(const ChunkHandler &ch)
*/
static void SlSaveChunk(const ChunkHandler &ch)
{
- ChunkSaveLoadProc *proc = ch.save_proc;
+ if (ch.type == CH_READONLY) return;
- /* Don't save any chunk information if there is no save handler. */
- if (proc == nullptr) return;
+ ChunkSaveLoadProc *proc = ch.save_proc;
+ assert(proc != nullptr);
SlWriteUint32(ch.id);
Debug(sl, 2, "Saving chunk {:c}{:c}{:c}{:c}", ch.id >> 24, ch.id >> 16, ch.id >> 8, ch.id);
diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h
index 1a4cb46e8..dfd687f35 100644
--- a/src/saveload/saveload.h
+++ b/src/saveload/saveload.h
@@ -388,6 +388,7 @@ enum ChunkType {
CH_RIFF = 0,
CH_ARRAY = 1,
CH_SPARSE_ARRAY = 2,
+ CH_READONLY, ///< Chunk is never saved.
};
/** Handlers and description of chunk. */
diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp
index 7144c5de4..a536c02db 100644
--- a/src/saveload/station_sl.cpp
+++ b/src/saveload/station_sl.cpp
@@ -703,7 +703,7 @@ static void Ptrs_ROADSTOP()
}
static const ChunkHandler station_chunk_handlers[] = {
- { 'STNS', nullptr, Load_STNS, Ptrs_STNS, nullptr, CH_ARRAY },
+ { 'STNS', nullptr, Load_STNS, Ptrs_STNS, nullptr, CH_READONLY },
{ 'STNN', Save_STNN, Load_STNN, Ptrs_STNN, nullptr, CH_ARRAY },
{ 'ROAD', Save_ROADSTOP, Load_ROADSTOP, Ptrs_ROADSTOP, nullptr, CH_ARRAY },
};
diff --git a/src/saveload/strings_sl.cpp b/src/saveload/strings_sl.cpp
index c4f56ed43..784d89d8f 100644
--- a/src/saveload/strings_sl.cpp
+++ b/src/saveload/strings_sl.cpp
@@ -132,7 +132,7 @@ static void Load_NAME()
/** Chunk handlers related to strings. */
static const ChunkHandler name_chunk_handlers[] = {
- { 'NAME', nullptr, Load_NAME, nullptr, nullptr, CH_ARRAY },
+ { 'NAME', nullptr, Load_NAME, nullptr, nullptr, CH_READONLY },
};
extern const ChunkHandlerTable _name_chunk_handlers(name_chunk_handlers);
diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp
index c94a90953..8105cc190 100644
--- a/src/saveload/waypoint_sl.cpp
+++ b/src/saveload/waypoint_sl.cpp
@@ -225,7 +225,7 @@ static void Ptrs_WAYP()
}
static const ChunkHandler waypoint_chunk_handlers[] = {
- { 'CHKP', nullptr, Load_WAYP, Ptrs_WAYP, nullptr, CH_ARRAY },
+ { 'CHKP', nullptr, Load_WAYP, Ptrs_WAYP, nullptr, CH_READONLY },
};
extern const ChunkHandlerTable _waypoint_chunk_handlers(waypoint_chunk_handlers);
diff --git a/src/settings.cpp b/src/settings.cpp
index 169549955..dab0fe08c 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -2105,7 +2105,7 @@ static void Save_PATS()
}
static const ChunkHandler setting_chunk_handlers[] = {
- { 'OPTS', nullptr, Load_OPTS, nullptr, nullptr, CH_RIFF },
+ { 'OPTS', nullptr, Load_OPTS, nullptr, nullptr, CH_READONLY },
{ 'PATS', Save_PATS, Load_PATS, nullptr, Check_PATS, CH_ARRAY },
};