From 3c9a1ffe5e5bb3c825e18e999ab913f29a0a571e Mon Sep 17 00:00:00 2001 From: Shiny Metagross <30511800+ShinyMetagross@users.noreply.github.com> Date: Mon, 15 Aug 2022 16:53:28 -0700 Subject: [PATCH] Give a fatal error when no mesh data is loaded - Part of having mesh data in an IQM includes joints. If a model doesn't have any mesh data to it, it won't have joints, and those are necessary. Poses are a different story however. --- src/common/models/models_iqm.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/models/models_iqm.cpp b/src/common/models/models_iqm.cpp index d468855ed..70efae4f9 100644 --- a/src/common/models/models_iqm.cpp +++ b/src/common/models/models_iqm.cpp @@ -59,6 +59,9 @@ bool IQMModel::Load(const char* path, int lumpnum, const char* buffer, int lengt uint32_t num_extensions = reader.ReadUInt32(); uint32_t ofs_extensions = reader.ReadUInt32(); + if (num_meshes <= 0) + I_FatalError("Invalid model: \"%s%s\", no mesh data is unsupported", path, fileSystem.GetLongName(mLumpNum)); + if (num_text == 0) return false;