From fea1ac2c0ff10f357ff54c6bb8a8176540fff8db Mon Sep 17 00:00:00 2001 From: cc9cii Date: Tue, 6 Jul 2021 14:21:17 +1000 Subject: [PATCH] Remove dead code from commit 024ad3276b472e0fc58b681d10566917e4d8d44d. --- components/esm/cellref.cpp | 15 ++++----------- components/esm/cellref.hpp | 4 ++-- components/esm/loadcell.cpp | 4 ++-- components/esm/loadcell.hpp | 3 +-- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/components/esm/cellref.cpp b/components/esm/cellref.cpp index dbe5828289..3628bac1b7 100644 --- a/components/esm/cellref.cpp +++ b/components/esm/cellref.cpp @@ -31,10 +31,10 @@ void ESM::RefNum::save (ESMWriter &esm, bool wide, const std::string& tag) const } -void ESM::CellRef::load (ESMReader& esm, bool &isDeleted, int *tempRefCount, bool wideRefNum) +void ESM::CellRef::load (ESMReader& esm, bool &isDeleted, bool wideRefNum) { loadId(esm, wideRefNum); - loadData(esm, isDeleted, tempRefCount); + loadData(esm, isDeleted); } void ESM::CellRef::loadId (ESMReader& esm, bool wideRefNum) @@ -57,7 +57,7 @@ void ESM::CellRef::loadId (ESMReader& esm, bool wideRefNum) } } -void ESM::CellRef::loadData(ESMReader &esm, bool &isDeleted, int *tempRefCount) +void ESM::CellRef::loadData(ESMReader &esm, bool &isDeleted) { isDeleted = false; @@ -119,14 +119,7 @@ void ESM::CellRef::loadData(ESMReader &esm, bool &isDeleted, int *tempRefCount) break; case ESM::FourCC<'N','A','M','0'>::value: { - if (tempRefCount && *tempRefCount == -1) - { - esm.getHT(*tempRefCount); - // TODO: check that there are no more subs following this sub - } - else - esm.skipHSub(); - + esm.skipHSub(); break; } case ESM::SREC_DELE: diff --git a/components/esm/cellref.hpp b/components/esm/cellref.hpp index 3e7a3a2f28..c2f7ff6de5 100644 --- a/components/esm/cellref.hpp +++ b/components/esm/cellref.hpp @@ -107,12 +107,12 @@ namespace ESM Position mPos; /// Calls loadId and loadData - void load (ESMReader& esm, bool &isDeleted, int *tempRefCount, bool wideRefNum = false); + void load (ESMReader& esm, bool &isDeleted, bool wideRefNum = false); void loadId (ESMReader& esm, bool wideRefNum = false); /// Implicitly called by load - void loadData (ESMReader& esm, bool &isDeleted, int *tempRefCount = nullptr); + void loadData (ESMReader& esm, bool &isDeleted); void save (ESMWriter &esm, bool wideRefNum = false, bool inInventory = false, bool isDeleted = false) const; diff --git a/components/esm/loadcell.cpp b/components/esm/loadcell.cpp index 8aeacd5116..2cb8761938 100644 --- a/components/esm/loadcell.cpp +++ b/components/esm/loadcell.cpp @@ -224,7 +224,7 @@ namespace ESM return region + ' ' + cellGrid; } - bool Cell::getNextRef(ESMReader &esm, CellRef &ref, bool &isDeleted, int *tempRefCount, bool ignoreMoves, MovedCellRef *mref) + bool Cell::getNextRef(ESMReader &esm, CellRef &ref, bool &isDeleted, bool ignoreMoves, MovedCellRef *mref) { isDeleted = false; @@ -252,7 +252,7 @@ namespace ESM if (esm.peekNextSub("FRMR")) { - ref.load (esm, isDeleted, tempRefCount); + ref.load (esm, isDeleted); // TODO: should count the number of temp refs and validate the number diff --git a/components/esm/loadcell.hpp b/components/esm/loadcell.hpp index ca4ca6e577..c49dc20c59 100644 --- a/components/esm/loadcell.hpp +++ b/components/esm/loadcell.hpp @@ -184,8 +184,7 @@ struct Cell /// \param ignoreMoves ignore MVRF record and read reference like a regular CellRef. static bool getNextRef(ESMReader &esm, CellRef &ref, - bool &isDeleted, - int *tempRefCount = nullptr, + bool &isDeleted, bool ignoreMoves = false, MovedCellRef *mref = nullptr);