From 9c0ed6955041285dfc9df39be6e06634a70c3239 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 25 Jan 2014 15:10:25 +0100 Subject: [PATCH] Fix CellRef loading issue causing a startup script failure when TR_Mainland.esm is loaded. --- components/esm/cellref.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/esm/cellref.cpp b/components/esm/cellref.cpp index b9f630290..19427af0c 100644 --- a/components/esm/cellref.cpp +++ b/components/esm/cellref.cpp @@ -18,6 +18,11 @@ void ESM::CellRef::load (ESMReader& esm, bool wideRefNum) mRefID = esm.getHNString ("NAME"); + // Again, UNAM sometimes appears after NAME and sometimes later. + // Or perhaps this UNAM means something different? + mReferenceBlocked = -1; + esm.getHNOT (mReferenceBlocked, "UNAM"); + mScale = 1.0; esm.getHNOT (mScale, "XSCL"); @@ -54,7 +59,6 @@ void ESM::CellRef::load (ESMReader& esm, bool wideRefNum) mKey = esm.getHNOString ("KNAM"); mTrap = esm.getHNOString ("TNAM"); - mReferenceBlocked = -1; mFltv = 0; esm.getHNOT (mReferenceBlocked, "UNAM"); esm.getHNOT (mFltv, "FLTV"); @@ -162,4 +166,4 @@ void ESM::CellRef::blank() bool ESM::operator== (const CellRef::RefNum& left, const CellRef::RefNum& right) { return left.mIndex==right.mIndex && left.mContentFile==right.mContentFile; -} \ No newline at end of file +}