Skip to content

Commit 9919f7e

Browse files
committed
engine: fix static prop lump version 10 loading
1 parent c7056b1 commit 9919f7e

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

engine/modelloader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@ IModelLoader *modelloader = ( IModelLoader * )&g_ModelLoader;
387387
//-----------------------------------------------------------------------------
388388
// Globals used by the CMapLoadHelper
389389
//-----------------------------------------------------------------------------
390-
static dheader_t s_MapHeader;
390+
dheader_t s_MapHeader;
391+
391392
static FileHandle_t s_MapFileHandle = FILESYSTEM_INVALID_HANDLE;
392393
static char s_szLoadName[128];
393394
static char s_szMapName[128];

engine/staticpropmgr.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ ConVar r_staticpropinfo( "r_staticpropinfo", "0" );
6060
ConVar r_drawmodeldecals( "r_drawmodeldecals", "1" );
6161
extern ConVar mat_fullbright;
6262
static bool g_MakingDevShots = false;
63+
extern dheader_t s_MapHeader;
6364
//-----------------------------------------------------------------------------
6465
// Index into the fade list
6566
//-----------------------------------------------------------------------------
@@ -1382,7 +1383,10 @@ void CStaticPropMgr::UnserializeModels( CUtlBuffer& buf )
13821383
break;
13831384

13841385
case 10:
1385-
buf.Get( &lump, sizeof( StaticPropLumpV10_t ) );
1386+
if( s_MapHeader.version >= 21 )
1387+
buf.Get( &lump, sizeof( StaticPropLumpV10_21_t ) );
1388+
else
1389+
buf.Get( &lump, sizeof( StaticPropLumpV10_t ) );
13861390
break;
13871391

13881392
case 11:

public/gamebspfile.h

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,29 @@ struct StaticPropLumpV9_t
271271
bool m_bDisableX360;
272272
};
273273

274-
// version 10
275274
struct StaticPropLumpV10_t
275+
{
276+
Vector m_Origin;
277+
QAngle m_Angles;
278+
unsigned short m_PropType;
279+
unsigned short m_FirstLeaf;
280+
unsigned short m_LeafCount;
281+
unsigned char m_Solid;
282+
int m_Skin;
283+
float m_FadeMinDist;
284+
float m_FadeMaxDist;
285+
Vector m_LightingOrigin;
286+
float m_flForcedFadeScale;
287+
unsigned short m_nMinDXLevel;
288+
unsigned short m_nMaxDXLevel;
289+
// int m_Lighting; // index into the GAMELUMP_STATIC_PROP_LIGHTING lump
290+
unsigned int m_Flags;
291+
unsigned short m_nLightmapResolutionX;
292+
unsigned short m_nLightmapResolutionY;
293+
};
294+
295+
// version 10
296+
struct StaticPropLumpV10_21_t
276297
{
277298
DECLARE_BYTESWAP_DATADESC();
278299
Vector m_Origin;

0 commit comments

Comments
 (0)