Skip to content

Commit

Permalink
🔧 Tolerate missing } in .skin file format, with warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
ohlidalp authored and Petr Ohlídal committed Mar 19, 2022
1 parent 251c9ea commit a4aed05
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions source/main/resources/skin_fileformat/SkinFileFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "SkinFileFormat.h"

#include "Application.h"
#include "Console.h"
#include "Utils.h"

#include <OgreEntity.h>
Expand Down Expand Up @@ -67,11 +68,22 @@ std::vector<std::shared_ptr<RoR::SkinDef>> 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<SkinDef>(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;
}
Expand Down

0 comments on commit a4aed05

Please # to comment.