From 34c30b132c58ca582c064efa128b120b248f6c3b Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 28 Aug 2012 10:12:22 +0200 Subject: [PATCH] Issue #378: workaround for bad ingredient records in Morrowind.esm --- components/esm/loadingr.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/esm/loadingr.cpp b/components/esm/loadingr.cpp index a745ff669..ddc9de0d5 100644 --- a/components/esm/loadingr.cpp +++ b/components/esm/loadingr.cpp @@ -12,6 +12,18 @@ void Ingredient::load(ESMReader &esm, const std::string& id) esm.getHNT(data, "IRDT", 56); script = esm.getHNOString("SCRI"); icon = esm.getHNOString("ITEX"); + + // horrible hack to fix broken data in records + for (int i=0; i<4; ++i) + { + if (data.effectID[i]!=85 && data.effectID[i]!=22 && data.effectID[i]!=17 && data.effectID[i]!=79 && + data.effectID[i]!=74) + data.attributes[i] = -1; + + if (data.effectID[i]!=89 && data.effectID[i]!=26 && data.effectID[i]!=21 && data.effectID[i]!=83 && + data.effectID[i]!=78) + data.skills[i] = -1; + } } }