|
@@ -314,11 +314,9 @@ static void SlNullPointers()
|
|
|
_sl_version = SAVEGAME_VERSION;
|
|
|
|
|
|
for (const ChunkHandler &ch : ChunkHandlers()) {
|
|
|
if (ch.fix_pointers) {
|
|
|
Debug(sl, 3, "Nulling pointers for {:c}{:c}{:c}{:c}", ch.id >> 24, ch.id >> 16, ch.id >> 8, ch.id);
|
|
|
ch.FixPointers();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
assert(_sl.action == SLA_NULL);
|
|
|
}
|
|
@@ -2114,30 +2112,8 @@ void SlAutolength(AutolengthProc *proc,
|
|
|
if (offs != _sl.dumper->GetSize()) SlErrorCorrupt("Invalid chunk size");
|
|
|
}
|
|
|
|
|
|
void ChunkHandler::Save() const
|
|
|
{
|
|
|
assert(this->save_proc != nullptr);
|
|
|
this->save_proc();
|
|
|
}
|
|
|
|
|
|
void ChunkHandler::Load() const
|
|
|
{
|
|
|
assert(this->load_proc != nullptr);
|
|
|
this->load_proc();
|
|
|
}
|
|
|
|
|
|
void ChunkHandler::FixPointers() const
|
|
|
{
|
|
|
assert(this->ptrs_proc != nullptr);
|
|
|
this->ptrs_proc();
|
|
|
}
|
|
|
|
|
|
void ChunkHandler::LoadCheck(size_t len) const
|
|
|
{
|
|
|
if (this->load_check) {
|
|
|
assert(this->load_check_proc != nullptr);
|
|
|
this->load_check_proc();
|
|
|
} else {
|
|
|
switch (_sl.block_mode) {
|
|
|
case CH_TABLE:
|
|
|
case CH_SPARSE_TABLE:
|
|
@@ -2154,7 +2130,6 @@ void ChunkHandler::LoadCheck(size_t len)
|
|
|
NOT_REACHED();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Load a chunk of data (eg vehicles, stations, etc.)
|
|
@@ -2352,11 +2327,9 @@ static void SlFixPointers()
|
|
|
_sl.action = SLA_PTRS;
|
|
|
|
|
|
for (const ChunkHandler &ch : ChunkHandlers()) {
|
|
|
if (ch.fix_pointers) {
|
|
|
Debug(sl, 3, "Fixing pointers for {:c}{:c}{:c}{:c}", ch.id >> 24, ch.id >> 16, ch.id >> 8, ch.id);
|
|
|
ch.FixPointers();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
assert(_sl.action == SLA_PTRS);
|
|
|
}
|