From 16b96e2c31c32968b99602771aa909b60fa25159 Mon Sep 17 00:00:00 2001 From: LP Date: Sun, 30 Nov 2025 18:51:25 +0800 Subject: [PATCH] Fix broken catacombs wall tile (#8296) * Fix broken catacombs wall tile When tile 15 is followed by tile 1 below, change tile 1 to tile 8 (left corner) to fix a visual glitch in the catacombs. * Silence fmt catch warnings and guard SaveHelper copy --- CMake/Tests.cmake | 1 + Source/levels/drlg_l2.cpp | 3 +++ Source/loadsave.cpp | 5 ++++- Source/lua/modules/log.cpp | 2 +- Source/utils/log.hpp | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMake/Tests.cmake b/CMake/Tests.cmake index 51f0033df..bb37b85b5 100644 --- a/CMake/Tests.cmake +++ b/CMake/Tests.cmake @@ -143,6 +143,7 @@ if(DEVILUTIONX_SCREENSHOT_FORMAT STREQUAL DEVILUTIONX_SCREENSHOT_FORMAT_PNG AND DevilutionX::SDL GTest::gmock GTest::gtest + fmt::fmt tl app_fatal_for_testing language_for_testing diff --git a/Source/levels/drlg_l2.cpp b/Source/levels/drlg_l2.cpp index e59db21af..716f907be 100644 --- a/Source/levels/drlg_l2.cpp +++ b/Source/levels/drlg_l2.cpp @@ -2064,6 +2064,9 @@ void FixTilesPatterns() if (dungeon[i][j] == 11 && dungeon[i + 1][j] == 14) { dungeon[i + 1][j] = 16; } + if (dungeon[i][j] == 15 && dungeon[i][j + 1] == 1) { + dungeon[i][j + 1] = 8; + } } } } diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index 59d3eafd7..75959092e 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -224,7 +224,10 @@ public: if (!IsValid(len)) return; - memcpy(&m_buffer_[m_cur_], bytes, len); + const auto *src = static_cast(bytes); + for (size_t i = 0; i < len; ++i) { + m_buffer_[m_cur_ + i] = src[i]; + } m_cur_ += len; } diff --git a/Source/lua/modules/log.cpp b/Source/lua/modules/log.cpp index 7a743c424..eea84a90e 100644 --- a/Source/lua/modules/log.cpp +++ b/Source/lua/modules/log.cpp @@ -56,7 +56,7 @@ void LuaLogMessage(LogPriority priority, std::string_view fmt, sol::variadic_arg // with an `FMT_EXCEPTIONS` check. std::string error = e.what(); #else - FMT_CATCH(const fmt::format_error) + FMT_CATCH(const fmt::format_error &) { std::string error = "unknown (FMT_EXCEPTIONS disabled)"; #endif diff --git a/Source/utils/log.hpp b/Source/utils/log.hpp index 1ada28c1d..028908e70 100644 --- a/Source/utils/log.hpp +++ b/Source/utils/log.hpp @@ -62,7 +62,7 @@ std::string format(std::string_view fmt, Args &&...args) // with an `FMT_EXCEPTIONS` check. std::string error = e.what(); #else - FMT_CATCH(const fmt::format_error) + FMT_CATCH(const fmt::format_error &) { std::string error = "unknown (FMT_EXCEPTIONS disabled)"; #endif