From a4aed05d487e0c1366b8b8dc4d056f687fe77b66 Mon Sep 17 00:00:00 2001 From: Petr Ohlidal Date: Thu, 17 Mar 2022 22:05:16 +0100 Subject: [PATCH] :wrench: Tolerate missing } in .skin file format, with warning. --- .../resources/skin_fileformat/SkinFileFormat.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/source/main/resources/skin_fileformat/SkinFileFormat.cpp b/source/main/resources/skin_fileformat/SkinFileFormat.cpp index ff2d419b53..4d81cfd80f 100644 --- a/source/main/resources/skin_fileformat/SkinFileFormat.cpp +++ b/source/main/resources/skin_fileformat/SkinFileFormat.cpp @@ -22,6 +22,7 @@ #include "SkinFileFormat.h" #include "Application.h" +#include "Console.h" #include "Utils.h" #include @@ -67,11 +68,22 @@ std::vector> RoR::SkinParser::ParseSkins(Ogre::Dat } } } + + if (curr_skin) + { + App::GetConsole()->putMessage( + Console::CONSOLE_MSGTYPE_ACTOR, Console::CONSOLE_SYSTEM_WARNING, + fmt::format("Skin '{}' in file '{}' not properly closed with '}}'", + curr_skin->name, stream->getName())); + result.push_back(std::shared_ptr(curr_skin.release())); // Submit anyway + } } catch (Ogre::Exception& e) { - RoR::LogFormat("[RoR] Error parsing skin file '%s', message: %s", - stream->getName().c_str(), e.getFullDescription().c_str()); + App::GetConsole()->putMessage( + Console::CONSOLE_MSGTYPE_ACTOR, Console::CONSOLE_SYSTEM_WARNING, + fmt::format("Error parsing skin file '{}', message: {}", + stream->getName(), e.getFullDescription())); } return result; }