From 46c61660cfb4aa3c3b1e5644ff2f200649d4925d Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 15 Dec 2023 07:37:40 +0300 Subject: [PATCH] engine: expose world BSP version through world global structure --- engine/common/mod_bmodel.c | 1 + engine/common/mod_local.h | 2 ++ engine/common/model.c | 1 + 3 files changed, 4 insertions(+) diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index 2e7d95c6..2adf38ae 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -2998,6 +2998,7 @@ static qboolean Mod_LoadBmodelLumps( model_t *mod, const byte *mod_base, qboolea if( isworld ) { + world.version = bmod->version; #if !XASH_DEDICATED Mod_InitDebugHulls( mod ); // FIXME: build hulls for separate bmodels (shells, medkits etc) world.deluxedata = bmod->deluxedata_out; // deluxemap data pointer diff --git a/engine/common/mod_local.h b/engine/common/mod_local.h index ccf6e7f0..c69d81e2 100644 --- a/engine/common/mod_local.h +++ b/engine/common/mod_local.h @@ -113,6 +113,8 @@ typedef struct world_static_s // tree visualization stuff int recursion_level; int max_recursion; + + uint32_t version; // BSP version } world_static_t; #ifndef REF_DLL diff --git a/engine/common/model.c b/engine/common/model.c index 3a25cc97..1553e5d9 100644 --- a/engine/common/model.c +++ b/engine/common/model.c @@ -111,6 +111,7 @@ void Mod_FreeModel( model_t *mod ) if( mod->type == mod_brush && FBitSet( mod->flags, MODEL_WORLD ) ) { + world.version = 0; world.shadowdata = NULL; world.deluxedata = NULL; }