mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-26 00:24:27 +00:00
fix: log and reject legacy raw terrain format, clean up ReadRaw API
Log a clear message and throw if the zone uses a legacy raw format (LUZ version < 30) since no known maps use it. Remove ReadLegacyRaw and the mapVersion parameter from ReadRaw. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -104,11 +104,17 @@ void Zone::LoadZoneIntoMemory() {
|
||||
}
|
||||
|
||||
auto rawFile = Game::assetManager->GetFile(zoneFolderPath + m_ZoneRawPath);
|
||||
if (!Raw::ReadRaw(rawFile, m_Raw)) {
|
||||
LOG("Failed to parse %s", (zoneFolderPath + m_ZoneRawPath).c_str());
|
||||
throw std::runtime_error("Aborting Zone loading due to invalid Raw File.");
|
||||
if (m_FileFormatVersion < Zone::FileFormatVersion::PrePreAlpha) {
|
||||
LOG("Zone %s uses legacy raw terrain format (version %u) which is not supported", m_ZoneFilePath.c_str(), static_cast<uint32_t>(m_FileFormatVersion));
|
||||
throw std::runtime_error("Aborting Zone loading due to unsupported Raw File version.");
|
||||
} else {
|
||||
if (Raw::ReadRaw(rawFile, m_Raw)) {
|
||||
LOG("Successfully parsed %s", (zoneFolderPath + m_ZoneRawPath).c_str());
|
||||
} else {
|
||||
LOG("Failed to parse %s", (zoneFolderPath + m_ZoneRawPath).c_str());
|
||||
throw std::runtime_error("Aborting Zone loading due to invalid Raw File.");
|
||||
}
|
||||
}
|
||||
LOG("Loaded Raw Terrain with %u chunks", m_Raw.numChunks);
|
||||
|
||||
|
||||
// Optionally export terrain mesh to OBJ for debugging/visualization
|
||||
|
||||
Reference in New Issue
Block a user