mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-04-09 17:26:58 +00:00
fix: add scaleFactor/width/height guards in GenerateTerrainMesh, fix %zu format specifier
Agent-Logs-Url: https://github.com/DarkflameUniverse/DarkflameServer/sessions/43d6190e-34b2-4d7f-8aaf-dd16bd77cc25 Co-authored-by: aronwk-aaron <26027722+aronwk-aaron@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
f6230532df
commit
d725da7d7c
@@ -381,15 +381,17 @@ namespace Raw {
|
|||||||
return; // No scene data available
|
return; // No scene data available
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG("GenerateTerrainMesh: Processing %u chunks", raw.chunks.size());
|
LOG("GenerateTerrainMesh: Processing %zu chunks", raw.chunks.size());
|
||||||
|
|
||||||
uint32_t vertexOffset = 0;
|
uint32_t vertexOffset = 0;
|
||||||
|
|
||||||
for (const auto& chunk : raw.chunks) {
|
for (const auto& chunk : raw.chunks) {
|
||||||
// Skip chunks without scene maps
|
// Skip chunks without scene maps or with invalid dimensions/scale
|
||||||
if (chunk.sceneMap.empty() || chunk.colorMapResolution == 0 || chunk.heightMap.empty()) {
|
if (chunk.sceneMap.empty() || chunk.colorMapResolution == 0 || chunk.heightMap.empty()
|
||||||
LOG("Skipping chunk %u (sceneMap: %zu, colorMapRes: %u, heightMap: %zu)",
|
|| chunk.scaleFactor <= 0.0f || chunk.width <= 1 || chunk.height <= 1) {
|
||||||
chunk.id, chunk.sceneMap.size(), chunk.colorMapResolution, chunk.heightMap.size());
|
LOG("Skipping chunk %u (sceneMap: %zu, colorMapRes: %u, heightMap: %zu, scaleFactor: %f, width: %u, height: %u)",
|
||||||
|
chunk.id, chunk.sceneMap.size(), chunk.colorMapResolution, chunk.heightMap.size(),
|
||||||
|
chunk.scaleFactor, chunk.width, chunk.height);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user