From 488bc76da5b33f8ac935a946134d7c24f77e8841 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Fri, 13 Mar 2015 22:06:55 +1100 Subject: [PATCH] Fix saving land data. --- apps/opencs/model/doc/savingstages.cpp | 2 ++ apps/opencs/model/world/data.cpp | 2 +- components/esm/loadland.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/opencs/model/doc/savingstages.cpp b/apps/opencs/model/doc/savingstages.cpp index 11aa8a7d1c..485ad094bf 100644 --- a/apps/opencs/model/doc/savingstages.cpp +++ b/apps/opencs/model/doc/savingstages.cpp @@ -376,6 +376,8 @@ void CSMDoc::WriteLandCollectionStage::perform (int stage, Messages& messages) mState.getWriter().startRecord (record.mLand->sRecordId); record.mLand->save (mState.getWriter()); + if(record.mLand->mLandData) + record.mLand->mLandData->save (mState.getWriter()); mState.getWriter().endRecord (record.mLand->sRecordId); } diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index 313518091f..39cff3db65 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -745,7 +745,7 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages) if (index!=-1 && !mBase) mLand.getRecord (index).mModified.mLand->loadData ( ESM::Land::DATA_VHGT | ESM::Land::DATA_VNML | ESM::Land::DATA_VCLR | - ESM::Land::DATA_VTEX); + ESM::Land::DATA_VTEX | ESM::Land::DATA_WNAM); break; } diff --git a/components/esm/loadland.cpp b/components/esm/loadland.cpp index ae73eee521..b1c01fcba6 100644 --- a/components/esm/loadland.cpp +++ b/components/esm/loadland.cpp @@ -11,7 +11,7 @@ namespace ESM void Land::LandData::save(ESMWriter &esm) { if (mDataTypes & Land::DATA_VNML) { - esm.writeHNT("VNML", mNormals, sizeof(VNML)); + esm.writeHNT("VNML", mNormals, sizeof(mNormals)); } if (mDataTypes & Land::DATA_VHGT) { VHGT offsets;