diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index 821c7035d..87a836f71 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -194,7 +194,7 @@ namespace MWWorld else { std::cerr - << "Error: could not resolve cell reference " << ref.mRefID + << "Error: could not resolve cell reference '" << ref.mRefID << "'" << " (dropping reference)" << std::endl; } } @@ -612,7 +612,7 @@ namespace MWWorld case ESM::REC_WEAP: mWeapons.load(ref, deleted, store); break; case ESM::REC_BODY: mBodyParts.load(ref, deleted, store); break; - case 0: std::cerr << "Cell reference " + ref.mRefID + " not found!\n"; break; + case 0: std::cerr << "Cell reference '" + ref.mRefID + "' not found!\n"; break; default: std::cerr diff --git a/components/esm/cellref.cpp b/components/esm/cellref.cpp index 7acaed86d..14fb14dd4 100644 --- a/components/esm/cellref.cpp +++ b/components/esm/cellref.cpp @@ -1,5 +1,7 @@ #include "cellref.hpp" +#include + #include "esmreader.hpp" #include "esmwriter.hpp" @@ -43,7 +45,13 @@ void ESM::CellRef::loadId (ESMReader& esm, bool wideRefNum) mRefNum.load (esm, wideRefNum); - mRefID = esm.getHNString ("NAME"); + mRefID = esm.getHNOString ("NAME"); + if (mRefID.empty()) + { + std::ios::fmtflags f(std::cerr.flags()); + std::cerr << "Warning: got CellRef with empty RefId in " << esm.getName() << " 0x" << std::hex << esm.getFileOffset() << std::endl; + std::cerr.flags(f); + } } void ESM::CellRef::loadData(ESMReader &esm, bool &isDeleted)