mirror of https://github.com/FWGS/hlsdk-xash3d
Merge branch 'master' into redempt
This commit is contained in:
commit
dcce15caf3
|
@ -22,6 +22,8 @@
|
||||||
#include "gamerules.h"
|
#include "gamerules.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
|
|
||||||
|
bool g_fIsXash3D = false;
|
||||||
|
|
||||||
void EntvarsKeyvalue( entvars_t *pev, KeyValueData *pkvd );
|
void EntvarsKeyvalue( entvars_t *pev, KeyValueData *pkvd );
|
||||||
|
|
||||||
extern "C" void PM_Move ( struct playermove_s *ppmove, int server );
|
extern "C" void PM_Move ( struct playermove_s *ppmove, int server );
|
||||||
|
@ -125,6 +127,11 @@ int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Server_GetPhysicsInterface( int version, server_physics_api_t *api, physics_interface_t *interface )
|
||||||
|
{
|
||||||
|
g_fIsXash3D = true;
|
||||||
|
return FALSE; // do not tell engine to init physics interface, as we're not using it
|
||||||
|
}
|
||||||
#if !XASH_WIN32
|
#if !XASH_WIN32
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -58,6 +58,11 @@ CBaseEntity
|
||||||
|
|
||||||
extern "C" EXPORT int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
|
extern "C" EXPORT int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion );
|
||||||
extern "C" EXPORT int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
|
extern "C" EXPORT int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );
|
||||||
|
// TODO: replace this by actual definitions from physint.h
|
||||||
|
typedef void *server_physics_api_t;
|
||||||
|
typedef void *physics_interface_t;
|
||||||
|
extern "C" EXPORT int Server_GetPhysicsInterface( int version, server_physics_api_t *api, physics_interface_t *interface );
|
||||||
|
extern bool g_fIsXash3D;
|
||||||
|
|
||||||
extern int DispatchSpawn( edict_t *pent );
|
extern int DispatchSpawn( edict_t *pent );
|
||||||
extern void DispatchKeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd );
|
extern void DispatchKeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd );
|
||||||
|
|
|
@ -58,12 +58,6 @@ void CGib::SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if( g_Language == LANGUAGE_GERMAN )
|
|
||||||
{
|
|
||||||
// no sticky gibs in germany right now!
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for( i = 0; i < cGibs; i++ )
|
for( i = 0; i < cGibs; i++ )
|
||||||
{
|
{
|
||||||
CGib *pGib = GetClassPtr( (CGib *)NULL );
|
CGib *pGib = GetClassPtr( (CGib *)NULL );
|
||||||
|
@ -126,16 +120,8 @@ void CGib::SpawnHeadGib( entvars_t *pevVictim )
|
||||||
{
|
{
|
||||||
CGib *pGib = GetClassPtr( (CGib *)NULL );
|
CGib *pGib = GetClassPtr( (CGib *)NULL );
|
||||||
|
|
||||||
if( g_Language == LANGUAGE_GERMAN )
|
|
||||||
{
|
|
||||||
pGib->Spawn( "models/germangibs.mdl" );// throw one head
|
|
||||||
pGib->pev->body = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pGib->Spawn( "models/hgibs.mdl" );// throw one head
|
pGib->Spawn( "models/hgibs.mdl" );// throw one head
|
||||||
pGib->pev->body = 0;
|
pGib->pev->body = 0;
|
||||||
}
|
|
||||||
|
|
||||||
if( pevVictim )
|
if( pevVictim )
|
||||||
{
|
{
|
||||||
|
@ -187,13 +173,6 @@ void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human )
|
||||||
{
|
{
|
||||||
CGib *pGib = GetClassPtr( (CGib *)NULL );
|
CGib *pGib = GetClassPtr( (CGib *)NULL );
|
||||||
|
|
||||||
if( g_Language == LANGUAGE_GERMAN )
|
|
||||||
{
|
|
||||||
pGib->Spawn( "models/germangibs.mdl" );
|
|
||||||
pGib->pev->body = RANDOM_LONG( 0, GERMAN_GIB_COUNT - 1 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if( human )
|
if( human )
|
||||||
{
|
{
|
||||||
// human pieces
|
// human pieces
|
||||||
|
@ -206,7 +185,6 @@ void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human )
|
||||||
pGib->Spawn( "models/agibs.mdl" );
|
pGib->Spawn( "models/agibs.mdl" );
|
||||||
pGib->pev->body = RANDOM_LONG( 0, ALIEN_GIB_COUNT - 1 );
|
pGib->pev->body = RANDOM_LONG( 0, ALIEN_GIB_COUNT - 1 );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if( pevVictim )
|
if( pevVictim )
|
||||||
{
|
{
|
||||||
|
@ -719,7 +697,7 @@ void CGib::BounceGibTouch( CBaseEntity *pOther )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( g_Language != LANGUAGE_GERMAN && m_cBloodDecals > 0 && m_bloodColor != DONT_BLEED )
|
if( m_cBloodDecals > 0 && m_bloodColor != DONT_BLEED )
|
||||||
{
|
{
|
||||||
vecSpot = pev->origin + Vector( 0.0f, 0.0f, 8.0f );//move up a bit, and trace down.
|
vecSpot = pev->origin + Vector( 0.0f, 0.0f, 8.0f );//move up a bit, and trace down.
|
||||||
UTIL_TraceLine( vecSpot, vecSpot + Vector( 0.0f, 0.0f, -24.0f ), ignore_monsters, ENT( pev ), &tr );
|
UTIL_TraceLine( vecSpot, vecSpot + Vector( 0.0f, 0.0f, -24.0f ), ignore_monsters, ENT( pev ), &tr );
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
#define BOLT_AIR_VELOCITY 2000
|
#define BOLT_AIR_VELOCITY 2000
|
||||||
#define BOLT_WATER_VELOCITY 1000
|
#define BOLT_WATER_VELOCITY 1000
|
||||||
|
|
||||||
extern BOOL g_fIsXash3D;
|
|
||||||
|
|
||||||
// UNDONE: Save/restore this? Don't forget to set classname and LINK_ENTITY_TO_CLASS()
|
// UNDONE: Save/restore this? Don't forget to set classname and LINK_ENTITY_TO_CLASS()
|
||||||
//
|
//
|
||||||
// OVERLOADS SOME ENTVARS:
|
// OVERLOADS SOME ENTVARS:
|
||||||
|
|
|
@ -1329,16 +1329,9 @@ IMPLEMENT_SAVERESTORE( CGibShooter, CBaseDelay )
|
||||||
LINK_ENTITY_TO_CLASS( gibshooter, CGibShooter )
|
LINK_ENTITY_TO_CLASS( gibshooter, CGibShooter )
|
||||||
|
|
||||||
void CGibShooter::Precache( void )
|
void CGibShooter::Precache( void )
|
||||||
{
|
|
||||||
if( g_Language == LANGUAGE_GERMAN )
|
|
||||||
{
|
|
||||||
m_iGibModelIndex = PRECACHE_MODEL( "models/germanygibs.mdl" );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
m_iGibModelIndex = PRECACHE_MODEL( "models/hgibs.mdl" );
|
m_iGibModelIndex = PRECACHE_MODEL( "models/hgibs.mdl" );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void CGibShooter::KeyValue( KeyValueData *pkvd )
|
void CGibShooter::KeyValue( KeyValueData *pkvd )
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "game.h"
|
#include "game.h"
|
||||||
|
|
||||||
BOOL g_fIsXash3D;
|
|
||||||
|
|
||||||
cvar_t displaysoundlist = {"displaysoundlist","0"};
|
cvar_t displaysoundlist = {"displaysoundlist","0"};
|
||||||
|
|
||||||
// multiplayer server rules
|
// multiplayer server rules
|
||||||
|
@ -469,10 +467,6 @@ cvar_t sv_busters = { "sv_busters", "0" };
|
||||||
// This gets called one time when the game is initialied
|
// This gets called one time when the game is initialied
|
||||||
void GameDLLInit( void )
|
void GameDLLInit( void )
|
||||||
{
|
{
|
||||||
// Register cvars here:
|
|
||||||
if( !CVAR_GET_POINTER( "sv_language" ) )
|
|
||||||
g_fIsXash3D = TRUE;
|
|
||||||
|
|
||||||
g_psv_gravity = CVAR_GET_POINTER( "sv_gravity" );
|
g_psv_gravity = CVAR_GET_POINTER( "sv_gravity" );
|
||||||
g_psv_aim = CVAR_GET_POINTER( "sv_aim" );
|
g_psv_aim = CVAR_GET_POINTER( "sv_aim" );
|
||||||
g_footsteps = CVAR_GET_POINTER( "mp_footsteps" );
|
g_footsteps = CVAR_GET_POINTER( "mp_footsteps" );
|
||||||
|
|
|
@ -36,4 +36,4 @@ DLL_GLOBAL int g_iSkillLevel;
|
||||||
DLL_GLOBAL int gDisplayTitle;
|
DLL_GLOBAL int gDisplayTitle;
|
||||||
DLL_GLOBAL BOOL g_fGameOver;
|
DLL_GLOBAL BOOL g_fGameOver;
|
||||||
DLL_GLOBAL const Vector g_vecZero = Vector( 0, 0, 0 );
|
DLL_GLOBAL const Vector g_vecZero = Vector( 0, 0, 0 );
|
||||||
DLL_GLOBAL int g_Language;
|
|
||||||
|
|
|
@ -800,7 +800,6 @@ void CBasePlayer::PackDeadPlayerItems( void )
|
||||||
|
|
||||||
iPW++;
|
iPW++;
|
||||||
}
|
}
|
||||||
end:
|
|
||||||
pWeaponBox->pev->velocity = pev->velocity * 1.2f;// weaponbox has player's velocity, then some.
|
pWeaponBox->pev->velocity = pev->velocity * 1.2f;// weaponbox has player's velocity, then some.
|
||||||
}
|
}
|
||||||
RemoveAllItems( TRUE );// now strip off everything that wasn't handled by the code above.
|
RemoveAllItems( TRUE );// now strip off everything that wasn't handled by the code above.
|
||||||
|
@ -3340,13 +3339,11 @@ void CBloodSplat::Spray( void )
|
||||||
{
|
{
|
||||||
TraceResult tr;
|
TraceResult tr;
|
||||||
|
|
||||||
if( g_Language != LANGUAGE_GERMAN )
|
|
||||||
{
|
|
||||||
UTIL_MakeVectors( pev->angles );
|
UTIL_MakeVectors( pev->angles );
|
||||||
UTIL_TraceLine( pev->origin, pev->origin + gpGlobals->v_forward * 128, ignore_monsters, pev->owner, & tr );
|
UTIL_TraceLine( pev->origin, pev->origin + gpGlobals->v_forward * 128, ignore_monsters, pev->owner, & tr );
|
||||||
|
|
||||||
UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED );
|
UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED );
|
||||||
}
|
|
||||||
SetThink( &CBaseEntity::SUB_Remove );
|
SetThink( &CBaseEntity::SUB_Remove );
|
||||||
pev->nextthink = gpGlobals->time + 0.1f;
|
pev->nextthink = gpGlobals->time + 0.1f;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1100,9 +1100,6 @@ void UTIL_BloodStream( const Vector &origin, const Vector &direction, int color,
|
||||||
if( !UTIL_ShouldShowBlood( color ) )
|
if( !UTIL_ShouldShowBlood( color ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( g_Language == LANGUAGE_GERMAN && color == BLOOD_COLOR_RED )
|
|
||||||
color = 0;
|
|
||||||
|
|
||||||
MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, origin );
|
MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, origin );
|
||||||
WRITE_BYTE( TE_BLOODSTREAM );
|
WRITE_BYTE( TE_BLOODSTREAM );
|
||||||
WRITE_COORD( origin.x );
|
WRITE_COORD( origin.x );
|
||||||
|
@ -1124,9 +1121,6 @@ void UTIL_BloodDrips( const Vector &origin, const Vector &direction, int color,
|
||||||
if( color == DONT_BLEED || amount == 0 )
|
if( color == DONT_BLEED || amount == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( g_Language == LANGUAGE_GERMAN && color == BLOOD_COLOR_RED )
|
|
||||||
color = 0;
|
|
||||||
|
|
||||||
if( g_pGameRules->IsMultiplayer() )
|
if( g_pGameRules->IsMultiplayer() )
|
||||||
{
|
{
|
||||||
// scale up blood effect in multiplayer for better visibility
|
// scale up blood effect in multiplayer for better visibility
|
||||||
|
|
12
dlls/util.h
12
dlls/util.h
|
@ -401,18 +401,6 @@ void DBG_AssertFunction(BOOL fExpr, const char* szExpr, const char* szFile, int
|
||||||
|
|
||||||
extern DLL_GLOBAL const Vector g_vecZero;
|
extern DLL_GLOBAL const Vector g_vecZero;
|
||||||
|
|
||||||
//
|
|
||||||
// Constants that were used only by QC (maybe not used at all now)
|
|
||||||
//
|
|
||||||
// Un-comment only as needed
|
|
||||||
//
|
|
||||||
#define LANGUAGE_ENGLISH 0
|
|
||||||
#define LANGUAGE_GERMAN 1
|
|
||||||
#define LANGUAGE_FRENCH 2
|
|
||||||
#define LANGUAGE_BRITISH 3
|
|
||||||
|
|
||||||
extern DLL_GLOBAL int g_Language;
|
|
||||||
|
|
||||||
#define AMBIENT_SOUND_STATIC 0 // medium radius attenuation
|
#define AMBIENT_SOUND_STATIC 0 // medium radius attenuation
|
||||||
#define AMBIENT_SOUND_EVERYWHERE 1
|
#define AMBIENT_SOUND_EVERYWHERE 1
|
||||||
#define AMBIENT_SOUND_SMALLRADIUS 2
|
#define AMBIENT_SOUND_SMALLRADIUS 2
|
||||||
|
|
|
@ -513,16 +513,8 @@ void CWorld::Precache( void )
|
||||||
PRECACHE_SOUND( "common/bodydrop3.wav" );// dead bodies hitting the ground (animation events)
|
PRECACHE_SOUND( "common/bodydrop3.wav" );// dead bodies hitting the ground (animation events)
|
||||||
PRECACHE_SOUND( "common/bodydrop4.wav" );
|
PRECACHE_SOUND( "common/bodydrop4.wav" );
|
||||||
|
|
||||||
g_Language = (int)CVAR_GET_FLOAT( "sv_language" );
|
|
||||||
if( g_Language == LANGUAGE_GERMAN )
|
|
||||||
{
|
|
||||||
PRECACHE_MODEL( "models/germangibs.mdl" );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
PRECACHE_MODEL( "models/hgibs.mdl" );
|
PRECACHE_MODEL( "models/hgibs.mdl" );
|
||||||
PRECACHE_MODEL( "models/agibs.mdl" );
|
PRECACHE_MODEL( "models/agibs.mdl" );
|
||||||
}
|
|
||||||
|
|
||||||
PRECACHE_SOUND( "weapons/ric1.wav" );
|
PRECACHE_SOUND( "weapons/ric1.wav" );
|
||||||
PRECACHE_SOUND( "weapons/ric2.wav" );
|
PRECACHE_SOUND( "weapons/ric2.wav" );
|
||||||
|
|
Loading…
Reference in New Issue