From 6c08e05fc323f17cf4136bf69e52af6e40971036 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 27 Jan 2015 22:57:30 +0100 Subject: [PATCH] ESSImport: fix for GMDT being only 92 bytes in a certain save file --- apps/essimporter/importgame.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/essimporter/importgame.cpp b/apps/essimporter/importgame.cpp index c9da71e0c..1012541b4 100644 --- a/apps/essimporter/importgame.cpp +++ b/apps/essimporter/importgame.cpp @@ -7,7 +7,20 @@ namespace ESSImport void GAME::load(ESM::ESMReader &esm) { - esm.getHNT(mGMDT, "GMDT"); + esm.getSubNameIs("GMDT"); + esm.getSubHeader(); + if (esm.getSubSize() == 92) + { + esm.getExact(&mGMDT, 92); + mGMDT.mSecundaPhase = 0; + } + else if (esm.getSubSize() == 96) + { + esm.getT(mGMDT); + } + else + esm.fail("unexpected subrecord size for GAME.GMDT"); + mGMDT.mWeatherTransition &= (0x000000ff); mGMDT.mSecundaPhase &= (0x000000ff); mGMDT.mMasserPhase &= (0x000000ff);