From 2d0ef9914ae871a9d5824e64fb727aadb2af2c97 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Wed, 30 Nov 2016 01:41:14 +0500 Subject: [PATCH 1/6] Prevent crash when pressed USE and called scripted_sequence. --- dlls/talkmonster.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/talkmonster.cpp b/dlls/talkmonster.cpp index a0a52f52..d832c2cc 100644 --- a/dlls/talkmonster.cpp +++ b/dlls/talkmonster.cpp @@ -1342,6 +1342,8 @@ BOOL CTalkMonster::CanFollow( void ) { if( m_MonsterState == MONSTERSTATE_SCRIPT ) { + if( !m_pCine ) + return FALSE; if( !m_pCine->CanInterrupt() ) return FALSE; } From 74edcd09b335be7a69bafa7f964645556eccb3e9 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Sun, 4 Dec 2016 00:41:40 +0500 Subject: [PATCH 2/6] Make duplicate global variables extern. --- pm_shared/pm_shared.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index a9ac380f..de855a50 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -30,8 +30,8 @@ #ifdef CLIENT_DLL // Spectator Mode int iJumpSpectator; - float vJumpOrigin[3]; - float vJumpAngles[3]; +extern float vJumpOrigin[3]; +extern float vJumpAngles[3]; #endif static int pm_shared_initialized = 0; From b7990e270d398a0ecd431cdbc37d37856e7f9e40 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Tue, 3 Jan 2017 00:49:22 +0300 Subject: [PATCH 3/6] Remove usage of MOVETYPE_COMPOUND to prevent crash --- dlls/crossbow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index d34ad25d..63d2efac 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -168,8 +168,8 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) pev->nextthink = gpGlobals->time + 10.0; // g-cont. Setup movewith feature - pev->movetype = MOVETYPE_COMPOUND; // set movewith type - 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 ) From 56aa9f4a9c9ab7704af9dbaf1cb72acc5623c1a5 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Wed, 4 Jan 2017 22:05:21 +0300 Subject: [PATCH 4/6] Put MOVETYPE_COMPOUND usage under if --- dlls/crossbow.cpp | 10 +++++++--- dlls/world.cpp | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index 63d2efac..45fd922c 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -27,6 +27,8 @@ #define BOLT_AIR_VELOCITY 2000 #define BOLT_WATER_VELOCITY 1000 +extern BOOL gPhysicsInterfaceInitialized; + // UNDONE: Save/restore this? Don't forget to set classname and LINK_ENTITY_TO_CLASS() // // OVERLOADS SOME ENTVARS: @@ -167,9 +169,11 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) pev->angles.z = RANDOM_LONG( 0, 360 ); pev->nextthink = gpGlobals->time + 10.0; - // g-cont. Setup movewith feature - //pev->movetype = MOVETYPE_COMPOUND; // set movewith type - //pev->aiment = ENT( pOther->pev ); // set parent + if (gPhysicsInterfaceInitialized) { + // g-cont. Setup movewith feature + pev->movetype = MOVETYPE_COMPOUND; // set movewith type + pev->aiment = ENT( pOther->pev ); // set parent + } } if( UTIL_PointContents( pev->origin ) != CONTENTS_WATER ) diff --git a/dlls/world.cpp b/dlls/world.cpp index fe119919..a065b5be 100644 --- a/dlls/world.cpp +++ b/dlls/world.cpp @@ -822,6 +822,8 @@ static physics_interface_t gPhysicsInterface = DispatchPhysicsEntity, }; +BOOL gPhysicsInterfaceInitialized = FALSE; + int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEngine, physics_interface_t *pFunctionTable ) { if( !pFunctionTable || !pfuncsFromEngine || iVersion != SV_PHYSICS_INTERFACE_VERSION ) @@ -834,6 +836,6 @@ int Server_GetPhysicsInterface( int iVersion, server_physics_api_t *pfuncsFromEn // fill engine callbacks memcpy( pFunctionTable, &gPhysicsInterface, sizeof(physics_interface_t) ); - + gPhysicsInterfaceInitialized = TRUE; return TRUE; } From 02532a478bfa63b6abdbbaf6c62e385ec8ba4eef Mon Sep 17 00:00:00 2001 From: mittorn Date: Tue, 10 Jan 2017 16:09:44 +0700 Subject: [PATCH 5/6] Fix visual studio server build --- dlls/effects.cpp | 4 ++-- dlls/nodes.cpp | 2 ++ dlls/weapons.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/effects.cpp b/dlls/effects.cpp index e9492dd6..ecc04a19 100644 --- a/dlls/effects.cpp +++ b/dlls/effects.cpp @@ -410,7 +410,7 @@ LINK_ENTITY_TO_CLASS( trip_beam, CTripBeam ) void CTripBeam::Spawn( void ) { CLightning::Spawn(); - SetTouch( &TriggerTouch ); + SetTouch( &CLightning::TriggerTouch ); pev->solid = SOLID_TRIGGER; RelinkBeam(); } @@ -1267,7 +1267,7 @@ void CSprite::TurnOn( void ) pev->effects = 0; if( ( pev->framerate && m_maxFrame > 1.0 ) || ( pev->spawnflags & SF_SPRITE_ONCE ) ) { - SetThink( &CSprite::CSprite::AnimateThink ); + SetThink( &CSprite::AnimateThink ); pev->nextthink = gpGlobals->time; m_lastTime = gpGlobals->time; } diff --git a/dlls/nodes.cpp b/dlls/nodes.cpp index ed4b4033..a97b6a80 100644 --- a/dlls/nodes.cpp +++ b/dlls/nodes.cpp @@ -45,6 +45,8 @@ LINK_ENTITY_TO_CLASS( info_node_air, CNodeEnt ) #include #include #define CreateDirectory(p, n) mkdir(p, 0777) +#else +#define CreateDirectory(p, n) CreateDirectoryA(p, n) #endif //========================================================= diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 3e2ef386..ff03bbfc 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -1080,7 +1080,7 @@ void CBasePlayerAmmo::DefaultTouch( CBaseEntity *pOther ) //========================================================= int CBasePlayerWeapon::ExtractAmmo( CBasePlayerWeapon *pWeapon ) { - int iReturn; + int iReturn = 0; if( pszAmmo1() != NULL ) { From 5da21e38d23be01669fade2747425dcc8692e0e9 Mon Sep 17 00:00:00 2001 From: mittorn Date: Tue, 10 Jan 2017 16:45:52 +0700 Subject: [PATCH 6/6] Fix client visual studio build --- cl_dll/hud_spectator.cpp | 2 +- cl_dll/input_xash3d.cpp | 2 +- cl_dll/util.cpp | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index 91e8fa37..ff6eb8ff 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -993,7 +993,7 @@ void CHudSpectator::DrawOverviewLayer() if ( hasMapImage) { i = m_MapSprite->numframes / (4*3); - i = sqrt(i); + i = sqrt(float(i)); xTiles = i*4; yTiles = i*3; } diff --git a/cl_dll/input_xash3d.cpp b/cl_dll/input_xash3d.cpp index 033af962..63cdfbeb 100644 --- a/cl_dll/input_xash3d.cpp +++ b/cl_dll/input_xash3d.cpp @@ -54,7 +54,7 @@ float rel_pitch; #define IMPULSE_DOWN 2 #define IMPULSE_UP 4 -bool CL_IsDead(); +int CL_IsDead( void ); Vector dead_viewangles(0, 0, 0); void IN_ToggleButtons( float forwardmove, float sidemove ) diff --git a/cl_dll/util.cpp b/cl_dll/util.cpp index 52dc2f61..655bde64 100644 --- a/cl_dll/util.cpp +++ b/cl_dll/util.cpp @@ -32,6 +32,10 @@ extern vec3_t vec3_origin; +#ifdef _MSC_VER +vec3_t vec3_origin; +#endif + double sqrt( double x ); float Length( const float *v )