diff --git a/apps/opencs/model/world/ref.cpp b/apps/opencs/model/world/ref.cpp index e25a1471ef..a0b7165533 100644 --- a/apps/opencs/model/world/ref.cpp +++ b/apps/opencs/model/world/ref.cpp @@ -3,15 +3,12 @@ #include "cell.hpp" -void CSMWorld::CellRef::load (ESM::ESMReader &esm) +void CSMWorld::CellRef::load (ESM::ESMReader &esm, Cell& cell, const std::string& id) { - // The CellRef is not loaded here. Because of the unfortunate way how the ESMReader and the cell - // record is constructed, we do not have enough context in this function to perform a load. + mId = id; -// mId = id; + cell.getNextRef (esm, *this); -// cell.getNextRef (esm, *this); - -// if (!mDeleted) -// cell.addRef (mId); -} + if (!mDeleted) + cell.addRef (mId); +} \ No newline at end of file diff --git a/apps/opencs/model/world/ref.hpp b/apps/opencs/model/world/ref.hpp index bf665b77a4..5b3e87f840 100644 --- a/apps/opencs/model/world/ref.hpp +++ b/apps/opencs/model/world/ref.hpp @@ -17,7 +17,8 @@ namespace CSMWorld { std::string mId; - void load (ESM::ESMReader &esm); + void load (ESM::ESMReader &esm, Cell& cell, const std::string& id); + ///< Load cell ref and register it with \a cell. }; }