From de5ce7059e5916f29be7ebce16f47e7fe4986335 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Fri, 11 Dec 2015 22:20:21 +1100 Subject: [PATCH] Use load message system for moved ref target cell error logging. --- apps/opencs/model/world/refcollection.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/opencs/model/world/refcollection.cpp b/apps/opencs/model/world/refcollection.cpp index 607e5690dd..0f894dc876 100644 --- a/apps/opencs/model/world/refcollection.cpp +++ b/apps/opencs/model/world/refcollection.cpp @@ -1,7 +1,5 @@ #include "refcollection.hpp" -#include - #include #include @@ -82,10 +80,13 @@ void CSMWorld::RefCollection::load (ESM::ESMReader& reader, int cellIndex, bool // message if (index.first != mref.mTarget[0] || index.second != mref.mTarget[1]) { - std::cerr << "The Position of moved ref " - << ref.mRefID << " does not match the target cell" << std::endl; - std::cerr << "Position: #" << index.first << " " << index.second - <<", Target #"<< mref.mTarget[0] << " " << mref.mTarget[1] << std::endl; + CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Cell, mCells.getId (cellIndex)); + messages.add (id, "The Position of moved ref " + ref.mRefID + " (#" + + std::to_string(index.first) + " " + std::to_string(index.second) + + ") does not match the target cell (#" + + std::to_string(mref.mTarget[0]) + " " + std::to_string(mref.mTarget[1]) + ")", + /*hint*/"", + CSMDoc::Message::Severity_Warning); // overwrite ref.mCell = "#" + std::to_string(mref.mTarget[0]) + " " + std::to_string(mref.mTarget[1]);