From b12aa46aae9f0c7c027c8a9191e28885b1007c77 Mon Sep 17 00:00:00 2001 From: Dave Corley Date: Sun, 10 Dec 2023 12:24:36 -0600 Subject: [PATCH] Fix(Land): Restore vanilla behavior of ignoring LAND subrecords which are not flagged to actually exist --- components/esm3/loadland.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/components/esm3/loadland.cpp b/components/esm3/loadland.cpp index ee0cca9bc4..2a40de61c3 100644 --- a/components/esm3/loadland.cpp +++ b/components/esm3/loadland.cpp @@ -101,23 +101,28 @@ namespace ESM { case fourCC("VNML"): esm.skipHSub(); - mDataTypes |= DATA_VNML; + if (mFlags & DATA_VNML) + mDataTypes |= DATA_VNML; break; case fourCC("VHGT"): esm.skipHSub(); - mDataTypes |= DATA_VHGT; + if (mFlags & DATA_VHGT) + mDataTypes |= DATA_VHGT; break; case fourCC("WNAM"): - esm.getHT(mWnam); - mDataTypes |= DATA_WNAM; + esm.getHExact(mWnam.data(), mWnam.size()); + if (mFlags & DATA_WNAM) + mDataTypes |= DATA_WNAM; break; case fourCC("VCLR"): esm.skipHSub(); - mDataTypes |= DATA_VCLR; + if (mFlags & DATA_VCLR) + mDataTypes |= DATA_VCLR; break; case fourCC("VTEX"): esm.skipHSub(); - mDataTypes |= DATA_VTEX; + if (mFlags & DATA_VCLR) + mDataTypes |= DATA_VTEX; break; default: esm.fail("Unknown subrecord");