From 9133182f2fb87b3a02a35a853b22b0f37337a249 Mon Sep 17 00:00:00 2001 From: greye Date: Tue, 5 Mar 2013 20:25:20 +0400 Subject: [PATCH] restore loading CELL records in esmtool --- components/esm/loadcell.cpp | 12 +++++++++++- components/esm/loadcell.hpp | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/components/esm/loadcell.cpp b/components/esm/loadcell.cpp index 92cb7d5ce..76a48e5ec 100644 --- a/components/esm/loadcell.cpp +++ b/components/esm/loadcell.cpp @@ -79,7 +79,7 @@ void CellRef::save(ESMWriter &esm) } } -void Cell::load(ESMReader &esm, MWWorld::ESMStore &store) +void Cell::load(ESMReader &esm, bool saveContext) { // Ignore this for now, it might mean we should delete the entire // cell? @@ -127,6 +127,16 @@ void Cell::load(ESMReader &esm, MWWorld::ESMStore &store) esm.getHT(mNAM0); } + if (saveContext) { + mContextList.push_back(esm.getContext()); + esm.skipRecord(); + } +} + +void Cell::load(ESMReader &esm, MWWorld::ESMStore &store) +{ + this->load(esm, false); + // preload moved references while (esm.isNextSub("MVRF")) { CellRef ref; diff --git a/components/esm/loadcell.hpp b/components/esm/loadcell.hpp index 6bde9972d..7db6dbe77 100644 --- a/components/esm/loadcell.hpp +++ b/components/esm/loadcell.hpp @@ -174,7 +174,7 @@ struct Cell // This method is left in for compatibility with esmtool. Parsing moved references currently requires // passing ESMStore, bit it does not know about this parameter, so we do it this way. - void load(ESMReader &esm) {}; + void load(ESMReader &esm, bool saveContext = true); void save(ESMWriter &esm); bool isExterior() const