1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:53:50 +00:00

Use Messages::add in skill record verifier

This commit is contained in:
Capostrophic 2018-08-25 05:16:49 +03:00
parent 35281d7c38
commit 1e5330d9da

View file

@ -1,7 +1,5 @@
#include "skillcheck.hpp"
#include <sstream>
#include <components/esm/loadskil.hpp>
#include "../prefs/state.hpp"
@ -33,16 +31,14 @@ void CSMTools::SkillCheckStage::perform (int stage, CSMDoc::Messages& messages)
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Skill, skill.mId);
if (skill.mDescription.empty())
messages.add(id, "Description is missing", "", CSMDoc::Message::Severity_Warning);
for (int i=0; i<4; ++i)
{
if (skill.mData.mUseValue[i]<0)
{
std::ostringstream stream;
stream << "Usage experience value #" << i << " is negative";
messages.push_back (std::make_pair (id, stream.str()));
messages.add(id, "Usage experience value #" + std::to_string(i) + " is negative", "", CSMDoc::Message::Severity_Error);
}
}
if (skill.mDescription.empty())
messages.push_back (std::make_pair (id, "Description is missing"));
}