From 57e9435d86dc54cb9a481e3f49d26da0330ea8fb Mon Sep 17 00:00:00 2001 From: Marukyu Date: Fri, 14 Oct 2016 21:37:36 +0200 Subject: [PATCH] Fixed some traps not rendering in dungeons saved with the in-game editor --- src/Client/LevelRenderer/ObjectAppearance.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Client/LevelRenderer/ObjectAppearance.cpp b/src/Client/LevelRenderer/ObjectAppearance.cpp index b529cbf..e2ba787 100644 --- a/src/Client/LevelRenderer/ObjectAppearance.cpp +++ b/src/Client/LevelRenderer/ObjectAppearance.cpp @@ -385,6 +385,10 @@ std::vector ObjectAppearanceManager::getObjectVertices(const Object& return vertices; } + // The in-game editor gives some objects a subtype of -1 to indicate that the property is unused. + // This workaround allows traps to remain visible in NecroEdit even after saving dungeons with them in-game. + variant = std::max(0, variant); + try { spriteData.nodeID = it->second.nodeIDs.at(variant);