From b5f4e3291e66b5cdc331f07c9a7ada03ad8ca883 Mon Sep 17 00:00:00 2001 From: DolceTriade Date: Fri, 3 Apr 2026 21:28:07 -0700 Subject: [PATCH] lerptag: Ensure we never return uninitialized data If for any reason, we fail to find a tag for iqm/md5 code, if the attachment is uninitialized like in the entity cache code, we will return NaNs. Fixes this crash for me: ``` tuple=...) at /mnt/media/code/unv-master/daemon/src/common/Util.h:136 at /mnt/media/code/unv-master/daemon/src/common/Util.h:141 ``` --- src/engine/renderer/tr_model.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/renderer/tr_model.cpp b/src/engine/renderer/tr_model.cpp index 43d10b437c..9df6a84346 100644 --- a/src/engine/renderer/tr_model.cpp +++ b/src/engine/renderer/tr_model.cpp @@ -442,6 +442,9 @@ int RE_LerpTagET( orientation_t* tag, const trRefEntity_t* ent, const char* tagN float frontLerp = frac; float backLerp = 1.0f - frac; + AxisClear( tag->axis ); + VectorClear( tag->origin ); + if ( model->type == modtype_t::MOD_MD5 || model->type == modtype_t::MOD_IQM ) { vec3_t tmp; @@ -476,8 +479,6 @@ int RE_LerpTagET( orientation_t* tag, const trRefEntity_t* ent, const char* tagN if ( !start || !end ) { - AxisClear( tag->axis ); - VectorClear( tag->origin ); return -1; }