From 0092aa07724b5bb03190dde95e3ba7dfa6f846d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Thu, 14 Mar 2024 18:51:42 -0300 Subject: [PATCH] Fix crash with DecoupledModels flag defined but no actual model --- src/r_data/models.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_data/models.cpp b/src/r_data/models.cpp index 3cca0791ca..09010c1954 100644 --- a/src/r_data/models.cpp +++ b/src/r_data/models.cpp @@ -1124,7 +1124,7 @@ FSpriteModelFrame * FindModelFrame(const AActor * thing, int sprite, int frame, if(thing->flags9 & MF9_DECOUPLEDANIMATIONS) { - return &BaseSpriteModelFrames[(thing->modelData != nullptr && thing->modelData->modelDef != nullptr) ? thing->modelData->modelDef : thing->GetClass()]; + return BaseSpriteModelFrames.CheckKey((thing->modelData != nullptr && thing->modelData->modelDef != nullptr) ? thing->modelData->modelDef : thing->GetClass()); } else {