From a90c848349a3586e248641e4246637d0454398d1 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Thu, 21 Sep 2023 13:54:28 +0300 Subject: [PATCH] Reject files with non-zero preceding separators This sign is typically bad news on some 10.0.1.2 files used in Oblivion. Technically our fault, but NifTools research is incomplete, will need to check if cc9cii found anything --- components/nif/niffile.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index 62516c1df7..d761d52b33 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -539,10 +539,8 @@ namespace Nif } // Record separator. Some Havok records in Oblivion do not have it. - if (hasRecordSeparators && !rec.starts_with("bhk")) - if (nif.get()) - Log(Debug::Warning) << "NIFFile Warning: Record of type " << rec << ", index " << i - << " is preceded by a non-zero separator. File: " << mFilename; + if (hasRecordSeparators && !rec.starts_with("bhk") && nif.get()) + throw Nif::Exception("Non-zero separator precedes " + rec + ", index " + std::to_string(i), mFilename); const auto entry = factories.find(rec);