From d5bacabbdc456b07987a57d26b0ae6e7ad024b3a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 31 Mar 2026 16:12:51 +0000 Subject: [PATCH] fix: add width/height/scaleFactor guards in SpawnScenePoints to prevent division by zero Agent-Logs-Url: https://github.com/DarkflameUniverse/DarkflameServer/sessions/386caefa-6a0f-4445-b3a5-3534ca2a5a93 Co-authored-by: aronwk-aaron <26027722+aronwk-aaron@users.noreply.github.com> --- dGame/dUtilities/SlashCommands/DEVGMCommands.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dGame/dUtilities/SlashCommands/DEVGMCommands.cpp b/dGame/dUtilities/SlashCommands/DEVGMCommands.cpp index 1913876f..1b3bc8dd 100644 --- a/dGame/dUtilities/SlashCommands/DEVGMCommands.cpp +++ b/dGame/dUtilities/SlashCommands/DEVGMCommands.cpp @@ -1962,7 +1962,8 @@ namespace DEVGMCommands { uint32_t spawnedCount = 0; for (const auto& chunk : raw.chunks) { - if (chunk.sceneMap.empty() || chunk.colorMapResolution == 0 || chunk.heightMap.empty()) continue; + if (chunk.sceneMap.empty() || chunk.colorMapResolution == 0 || chunk.heightMap.empty() + || chunk.width <= 1 || chunk.height <= 1 || chunk.scaleFactor <= 0.0f) continue; // Iterate through the heightmap (same as GenerateTerrainMesh) for (uint32_t i = 0; i < chunk.width; ++i) {