From 8cbc7819a625b7c0e890ddcdbe7cc5bca7a2fc14 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 19 Jan 2026 22:00:33 +0500 Subject: [PATCH] engine: common: transform asserts into Host_Error calls in Mod_LoadModel --- engine/common/model.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/engine/common/model.c b/engine/common/model.c index b7190e40..ca06b5d2 100644 --- a/engine/common/model.c +++ b/engine/common/model.c @@ -267,7 +267,11 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash ) byte *buf; model_info_t *p; - ASSERT( mod != NULL ); + if( !mod ) + { + Host_Error( "%s: mod == NULL\n", __func__ ); + return NULL; + } // check if already loaded (or inline bmodel) if( mod->mempool || mod->name[0] == '*' ) @@ -276,7 +280,11 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash ) return mod; } - ASSERT( mod->needload == NL_NEEDS_LOADED ); + if( mod->needload != NL_NEEDS_LOADED ) + { + Host_Error( "%s: trying to load model not marked for loading (%d)\n", __func__, mod->needload ); + return NULL; + } // store modelname to show error Q_strncpy( tempname, mod->name, sizeof( tempname ));