Merge branch 'master' of https://github.com/SDLash3D/hlsdk-xash3d into gravgun

This commit is contained in:
mittorn 2017-01-18 20:24:01 +00:00
commit 4c70acf01d
10 changed files with 25 additions and 11 deletions

View File

@ -993,7 +993,7 @@ void CHudSpectator::DrawOverviewLayer()
if ( hasMapImage) if ( hasMapImage)
{ {
i = m_MapSprite->numframes / (4*3); i = m_MapSprite->numframes / (4*3);
i = sqrt(i); i = sqrt(float(i));
xTiles = i*4; xTiles = i*4;
yTiles = i*3; yTiles = i*3;
} }

View File

@ -54,7 +54,7 @@ float rel_pitch;
#define IMPULSE_DOWN 2 #define IMPULSE_DOWN 2
#define IMPULSE_UP 4 #define IMPULSE_UP 4
bool CL_IsDead(); int CL_IsDead( void );
Vector dead_viewangles(0, 0, 0); Vector dead_viewangles(0, 0, 0);
void IN_ToggleButtons( float forwardmove, float sidemove ) void IN_ToggleButtons( float forwardmove, float sidemove )

View File

@ -32,6 +32,10 @@
extern vec3_t vec3_origin; extern vec3_t vec3_origin;
#ifdef _MSC_VER
vec3_t vec3_origin;
#endif
double sqrt( double x ); double sqrt( double x );
float Length( const float *v ) float Length( const float *v )

View File

@ -27,6 +27,8 @@
#define BOLT_AIR_VELOCITY 2000 #define BOLT_AIR_VELOCITY 2000
#define BOLT_WATER_VELOCITY 1000 #define BOLT_WATER_VELOCITY 1000
extern BOOL gPhysicsInterfaceInitialized;
// 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:
@ -181,9 +183,11 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther )
pev->angles.z = RANDOM_LONG( 0, 360 ); pev->angles.z = RANDOM_LONG( 0, 360 );
pev->nextthink = gpGlobals->time + 60.0; pev->nextthink = gpGlobals->time + 60.0;
// g-cont. Setup movewith feature if (gPhysicsInterfaceInitialized) {
pev->movetype = MOVETYPE_COMPOUND; // set movewith type // g-cont. Setup movewith feature
pev->aiment = ENT( pOther->pev ); // set parent pev->movetype = MOVETYPE_COMPOUND; // set movewith type
pev->aiment = ENT( pOther->pev ); // set parent
}
} }
if( UTIL_PointContents( pev->origin ) != CONTENTS_WATER ) if( UTIL_PointContents( pev->origin ) != CONTENTS_WATER )

View File

@ -411,7 +411,7 @@ LINK_ENTITY_TO_CLASS( trip_beam, CTripBeam )
void CTripBeam::Spawn( void ) void CTripBeam::Spawn( void )
{ {
CLightning::Spawn(); CLightning::Spawn();
SetTouch( &TriggerTouch ); SetTouch( &CLightning::TriggerTouch );
pev->solid = SOLID_TRIGGER; pev->solid = SOLID_TRIGGER;
RelinkBeam(); RelinkBeam();
} }
@ -1268,7 +1268,7 @@ void CSprite::TurnOn( void )
pev->effects = 0; pev->effects = 0;
if( ( pev->framerate && m_maxFrame > 1.0 ) || ( pev->spawnflags & SF_SPRITE_ONCE ) ) if( ( pev->framerate && m_maxFrame > 1.0 ) || ( pev->spawnflags & SF_SPRITE_ONCE ) )
{ {
SetThink( &CSprite::CSprite::AnimateThink ); SetThink( &CSprite::AnimateThink );
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
m_lastTime = gpGlobals->time; m_lastTime = gpGlobals->time;
} }

View File

@ -45,6 +45,8 @@ LINK_ENTITY_TO_CLASS( info_node_air, CNodeEnt )
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#define CreateDirectory(p, n) mkdir(p, 0777) #define CreateDirectory(p, n) mkdir(p, 0777)
#else
#define CreateDirectory(p, n) CreateDirectoryA(p, n)
#endif #endif
//========================================================= //=========================================================

View File

@ -1342,6 +1342,8 @@ BOOL CTalkMonster::CanFollow( void )
{ {
if( m_MonsterState == MONSTERSTATE_SCRIPT ) if( m_MonsterState == MONSTERSTATE_SCRIPT )
{ {
if( !m_pCine )
return FALSE;
if( !m_pCine->CanInterrupt() ) if( !m_pCine->CanInterrupt() )
return FALSE; return FALSE;
} }

View File

@ -1243,7 +1243,7 @@ void CBasePlayerAmmo::DefaultTouch( CBaseEntity *pOther )
//========================================================= //=========================================================
int CBasePlayerWeapon::ExtractAmmo( CBasePlayerWeapon *pWeapon ) int CBasePlayerWeapon::ExtractAmmo( CBasePlayerWeapon *pWeapon )
{ {
int iReturn; int iReturn = 0;
if( pszAmmo1() != NULL ) if( pszAmmo1() != NULL )
{ {

View File

@ -825,6 +825,8 @@ static physics_interface_t gPhysicsInterface =
DispatchPhysicsEntity, DispatchPhysicsEntity,
}; };
BOOL gPhysicsInterfaceInitialized = FALSE;
int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEngine, physics_interface_t *pFunctionTable ) int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEngine, physics_interface_t *pFunctionTable )
{ {
if( !pFunctionTable || !pfuncsFromEngine || iVersion != SV_PHYSICS_INTERFACE_VERSION ) if( !pFunctionTable || !pfuncsFromEngine || iVersion != SV_PHYSICS_INTERFACE_VERSION )
@ -837,6 +839,6 @@ int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEn
// fill engine callbacks // fill engine callbacks
memcpy( pFunctionTable, &gPhysicsInterface, sizeof(physics_interface_t) ); memcpy( pFunctionTable, &gPhysicsInterface, sizeof(physics_interface_t) );
gPhysicsInterfaceInitialized = TRUE;
return TRUE; return TRUE;
} }

View File

@ -33,8 +33,8 @@
#ifdef CLIENT_DLL #ifdef CLIENT_DLL
// Spectator Mode // Spectator Mode
int iJumpSpectator; int iJumpSpectator;
float vJumpOrigin[3]; extern float vJumpOrigin[3];
float vJumpAngles[3]; extern float vJumpAngles[3];
#endif #endif
static int pm_shared_initialized = 0; static int pm_shared_initialized = 0;