From 94ec05c2c6f1a86710b4a2f6754259553db91c1b Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 18 Jun 2013 11:27:05 +0200 Subject: [PATCH] Revert "simplifying CSMWorld::CellRef" With the refactored collection class we can now handle the more complex load function This reverts commit 97f421df8a5a3f6e4803001af8014355128d8523. --- apps/opencs/model/world/ref.cpp | 15 ++++++--------- apps/opencs/model/world/ref.hpp | 3 ++- 2 files changed, 8 insertions(+), 10 deletions(-) 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. }; }