diff --git a/code/renderer/tr_bsp.c b/code/renderer/tr_bsp.c index 6d76e19cc..0c4900db2 100644 --- a/code/renderer/tr_bsp.c +++ b/code/renderer/tr_bsp.c @@ -39,7 +39,7 @@ void RE_LoadWorldMap( const char *name ); #ifdef USE_BSP_MODELS #define MAX_WORLD_MODELS 64 int rwi = 0; -static world_t s_worldDatas[MAX_WORLD_MODELS]; +world_t s_worldDatas[MAX_WORLD_MODELS]; #define s_worldData s_worldDatas[rwi] #ifdef tr #undef tr diff --git a/code/renderer/tr_init.c b/code/renderer/tr_init.c index e65997a6c..15c3120f4 100644 --- a/code/renderer/tr_init.c +++ b/code/renderer/tr_init.c @@ -1904,6 +1904,11 @@ static void R_Register( void ) #define EPSILON 1e-6f + +#ifdef USE_BSP_MODELS +extern world_t s_worldDatas[MAX_WORLD_MODELS]; +#endif + /* =============== R_Init @@ -1918,6 +1923,10 @@ void R_Init( void ) { ri.Printf( PRINT_ALL, "----- R_Init -----\n" ); // clear all our internal state +#ifdef USE_BSP_MODELS + Com_Memset( &trWorlds, 0, sizeof( trWorlds ) ); + Com_Memset( &s_worldDatas, 0, sizeof( s_worldDatas ) ); +#endif #ifdef USE_MULTIVM_RENDERER Com_Memset( &trWorlds, 0, sizeof( trWorlds ) ); Com_Memset( &backEnd, 0, sizeof( backEnd ) );