mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-08 13:21:51 +08:00
engine: turn bugcomp into flags that can be enabled/disabled separately
This commit is contained in:
@@ -3344,12 +3344,10 @@ pfnPEntityOfEntIndex
|
||||
|
||||
=============
|
||||
*/
|
||||
static edict_t *pfnPEntityOfEntIndex( int iEntIndex )
|
||||
static edict_t *pfnPEntityOfEntIndexBroken( int iEntIndex )
|
||||
{
|
||||
// have to be bug-compatible with GoldSrc in this function
|
||||
if( host.bugcomp == BUGCOMP_GOLDSRC )
|
||||
return SV_PEntityOfEntIndex( iEntIndex, false );
|
||||
return SV_PEntityOfEntIndex( iEntIndex, true );
|
||||
return SV_PEntityOfEntIndex( iEntIndex, false );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4684,7 +4682,7 @@ static enginefuncs_t gEngfuncs =
|
||||
pfnPEntityOfEntOffset,
|
||||
pfnEntOffsetOfPEntity,
|
||||
pfnIndexOfEdict,
|
||||
pfnPEntityOfEntIndex,
|
||||
pfnPEntityOfEntIndexAllEntities,
|
||||
pfnFindEntityByVars,
|
||||
pfnGetModelPtr,
|
||||
pfnRegUserMsg,
|
||||
@@ -5155,6 +5153,11 @@ qboolean SV_LoadProgs( const char *name )
|
||||
// make sure what physic functions is cleared
|
||||
memset( &svgame.physFuncs, 0, sizeof( svgame.physFuncs ));
|
||||
|
||||
// revert fix for pfnPEntityOfEntIndex to be compatible with GoldSrc
|
||||
// games that rely on this bug
|
||||
if( FBitSet( host.bugcomp, BUGCOMP_PENTITYOFENTINDEX_FLAG ))
|
||||
gEngfuncs.pfnPEntityOfEntIndex = pfnPEntityOfEntIndexBroken;
|
||||
|
||||
// make local copy of engfuncs to prevent overwrite it with bots.dll
|
||||
memcpy( &gpEngfuncs, &gEngfuncs, sizeof( gpEngfuncs ));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user