*         Upgraded Steamworks SDK to v1.29
*         Fixed mod compatibility problem with Multiplayer Base that was introduced in September.
*         In Hammer, while using the Vertex Tool, pressing CTRL+B will snap selected vertices to the grid.

Virtual Reality:
*         Mods that support virtual reality now need to have a line in gameinfo.txt that says “supportsvr 1”. This indicates to gameui and engine that certain UI should be enabled.
*         VR-enabled mods will now start up in VR mode when launched from Steam’s VR mode.

Windows:
*         Upgraded to Visual Studio 2013. If you need to build projects for VS 2010, add /2010 to your VPC command line.

OSX:
*         Upgraded to XCode 5.
This commit is contained in:
Joe Ludwig
2014-05-15 13:59:18 -07:00
parent 7309a5f13f
commit 53e78c503e
360 changed files with 4720 additions and 1689 deletions

View File

@@ -589,7 +589,7 @@ void DrawTeslaSegs( int noise_divisions, float *prgNoise, const model_t* spritem
curSeg.m_flWidth = ((fraction*(endWidth-startWidth))+startWidth) * 2;
// Reduce the width by the current number of branches we've had
for ( int j = 0; i < iBranches; j++ )
for ( int j = 0; j < iBranches; j++ )
{
curSeg.m_flWidth *= 0.5;
}
@@ -619,7 +619,7 @@ void DrawTeslaSegs( int noise_divisions, float *prgNoise, const model_t* spritem
// Reduce the end width by the current number of branches we've had
flEndWidth = endWidth;
for ( int j = 0; i < iBranches; j++ )
for ( int j = 0; j < iBranches; j++ )
{
flEndWidth *= 0.5;
}

View File

@@ -3687,6 +3687,8 @@ void C_BaseAnimating::FireEvent( const Vector& origin, const QAngle& angles, int
if ( token )
{
const char* mtoken = ModifyEventParticles( token );
if ( !mtoken || mtoken[0] == '\0' )
return;
Q_strncpy( szParticleEffect, mtoken, sizeof(szParticleEffect) );
}
@@ -5298,8 +5300,8 @@ void C_BaseAnimating::ResetSequenceInfo( void )
m_bSequenceFinished = false;
m_flLastEventCheck = 0;
m_nNewSequenceParity = ( ++m_nNewSequenceParity ) & EF_PARITY_MASK;
m_nResetEventsParity = ( ++m_nResetEventsParity ) & EF_PARITY_MASK;
m_nNewSequenceParity = ( m_nNewSequenceParity + 1 ) & EF_PARITY_MASK;
m_nResetEventsParity = ( m_nResetEventsParity + 1 ) & EF_PARITY_MASK;
// FIXME: why is this called here? Nothing should have changed to make this nessesary
SetEventIndexForSequence( pStudioHdr->pSeqdesc( GetSequence() ) );

View File

@@ -122,7 +122,7 @@ void C_ColorCorrection::ClientThink()
return;
}
CBaseEntity *pPlayer = UTIL_PlayerByIndex(1);
C_BaseEntity *pPlayer = C_BasePlayer::GetLocalPlayer();
if( !pPlayer )
return;

View File

@@ -154,7 +154,7 @@ private:
Assert( type < NUM_EDGE_STYLES );
Assert( type >= 0 );
// Clear old value
m_nPanelBits[ w ][ h ] &= ( ~0x03 << 2 );
m_nPanelBits[ w ][ h ] &= 0xF0; // ( ~0x03 << 2 ); Left shifting a negative value has undefined behavior. Use the constant 0xF0 instead.
// Insert new value
m_nPanelBits[ w ][ h ] |= ( type << 2 );
}

View File

@@ -114,7 +114,7 @@ void TE_BloodStream( IRecipientFilter& filter, float delay,
float arc = 0.05;
int count, count2;
float num;
int speedCopy = amount;
float speedCopy = amount;
Vector dir;
VectorCopy( *direction, dir );

View File

@@ -139,7 +139,7 @@ void TE_Decal( IRecipientFilter& filter, float delay,
// Only decal the world + brush models
// Here we deal with decals on entities.
C_BaseEntity* ent;
if ( ( ent = cl_entitylist->GetEnt( entity ) ) == false )
if ( ( ent = cl_entitylist->GetEnt( entity ) ) == NULL )
return;
ent->AddDecal( *start, *pos, *pos, hitbox,

View File

@@ -1717,7 +1717,11 @@ void CHLClient::LevelShutdown( void )
messagechars->Clear();
#ifndef TF_CLIENT_DLL
// don't want to do this for TF2 because we have particle systems in our
// character loadout screen that can be viewed when we're not connected to a server
g_pParticleSystemMgr->UncacheAllParticleSystems();
#endif
UncacheAllMaterials();
#ifdef _XBOX

View File

@@ -21,6 +21,7 @@
#include "vgui_controls/Controls.h"
#include "tier0/vprof_telemetry.h"
#include <time.h>
#include "steam/steam_api.h"
const char *COM_GetModDirectory(); // return the mod dir (rather than the complete -game param, which can be a path)
@@ -260,6 +261,8 @@ CClientVirtualReality::CClientVirtualReality()
m_rtLastMotionSample = 0;
m_bMotionUpdated = false;
m_bForceVRMode = false;
#if defined( USE_SDL )
m_nNonVRSDLDisplayIndex = 0;
#endif
@@ -1363,28 +1366,32 @@ void CClientVirtualReality::Activate()
if( !g_pSourceVR )
return;
// see if VR mode is even enabled
if( materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter == -1 )
// These checks don't apply if we're in VR mode because Steam said so.
if ( !m_bForceVRMode )
{
Warning( "Enable VR mode in the video options before trying to use it.\n" );
return;
}
// see if VR mode is even enabled
if ( materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter == -1 )
{
Warning( "Enable VR mode in the video options before trying to use it.\n" );
return;
}
// See if we have an actual adapter
int32 nVRModeAdapter = g_pSourceVR->GetVRModeAdapter();
if( nVRModeAdapter == -1 )
{
Warning( "Unable to get VRMode adapter from OpenVR. VR mode cannot be enabled. Try restarting and then enabling VR again.\n" );
return;
}
// See if we have an actual adapter
int32 nVRModeAdapter = g_pSourceVR->GetVRModeAdapter();
if ( nVRModeAdapter == -1 )
{
Warning( "Unable to get VRMode adapter from OpenVR. VR mode cannot be enabled. Try restarting and then enabling VR again.\n" );
return;
}
// we can only activate if we've got a VR device
if( materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter != nVRModeAdapter )
{
Warning( "VR Mode expects adapter %d which is different from %d which we are currently using. Try restarting and enabling VR mode again.\n",
nVRModeAdapter, materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter );
engine->ExecuteClientCmd( "mat_enable_vrmode 0\n" );
return;
// we can only activate if we've got a VR device
if ( materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter != nVRModeAdapter )
{
Warning( "VR Mode expects adapter %d which is different from %d which we are currently using. Try restarting and enabling VR mode again.\n",
nVRModeAdapter, materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter );
engine->ExecuteClientCmd( "mat_enable_vrmode 0\n" );
return;
}
}
@@ -1429,18 +1436,22 @@ void CClientVirtualReality::Activate()
int nViewportWidth, nViewportHeight;
g_pSourceVR->GetViewportBounds( ISourceVirtualReality::VREye_Left, NULL, NULL, &nViewportWidth, &nViewportHeight );
vgui::surface()->SetFullscreenViewportAndRenderTarget( 0, 0, nViewportWidth, nViewportHeight, g_pSourceVR->GetRenderTarget( ISourceVirtualReality::VREye_Left, ISourceVirtualReality::RT_Color ) );
g_pMatSystemSurface->SetFullscreenViewportAndRenderTarget( 0, 0, nViewportWidth, nViewportHeight, g_pSourceVR->GetRenderTarget( ISourceVirtualReality::VREye_Left, ISourceVirtualReality::RT_Color ) );
vgui::ivgui()->SetVRMode( true );
VRRect_t rect;
if( g_pSourceVR->GetDisplayBounds( &rect ) )
// we can skip this extra mode change if we've always been in VR mode
if ( !m_bForceVRMode )
{
VRRect_t rect;
if ( g_pSourceVR->GetDisplayBounds( &rect ) )
{
// set mode
char szCmd[ 256 ];
Q_snprintf( szCmd, sizeof( szCmd ), "mat_setvideomode %i %i %i\n", rect.nWidth, rect.nHeight, vr_force_windowed.GetBool()? 1 : 0 );
engine->ClientCmd_Unrestricted( szCmd );
// set mode
char szCmd[256];
Q_snprintf( szCmd, sizeof(szCmd), "mat_setvideomode %i %i %i\n", rect.nWidth, rect.nHeight, vr_force_windowed.GetBool() ? 1 : 0 );
engine->ClientCmd_Unrestricted( szCmd );
}
}
}
@@ -1455,7 +1466,7 @@ void CClientVirtualReality::Deactivate()
g_pMatSystemSurface->ForceScreenSizeOverride(false, 0, 0 );
g_pMaterialSystem->GetRenderContext()->Viewport( 0, 0, m_nNonVRWidth, m_nNonVRHeight );
vgui::surface()->SetFullscreenViewportAndRenderTarget( 0, 0, m_nNonVRWidth, m_nNonVRHeight, NULL );
g_pMatSystemSurface->SetFullscreenViewportAndRenderTarget( 0, 0, m_nNonVRWidth, m_nNonVRHeight, NULL );
static ConVarRef cl_software_cursor( "cl_software_cursor" );
vgui::surface()->SetSoftwareCursor( cl_software_cursor.GetBool() );
@@ -1499,7 +1510,10 @@ void CClientVirtualReality::Deactivate()
// Called when startup is complete
void CClientVirtualReality::StartupComplete()
{
if( vr_activate_default.GetBool() )
if ( g_pSourceVR )
m_bForceVRMode = g_pSourceVR->ShouldForceVRMode();
if ( vr_activate_default.GetBool( ) || m_bForceVRMode )
Activate();
}

View File

@@ -147,6 +147,7 @@ private:
int m_iAlignTorsoAndViewToWeaponCountdown;
bool m_bMotionUpdated;
bool m_bForceVRMode;
RTime32 m_rtLastMotionSample;

View File

@@ -228,9 +228,9 @@ static void __MsgFunc_VGUIMenu( bf_read &msg )
&& keys->GetInt( "type", 0 ) == 2 // URL message type
) {
const char *pszURL = keys->GetString( "msg", "" );
if ( Q_strncmp( pszURL, "http://", 7 ) != 0 && Q_strncmp( pszURL, "https://", 8 ) != 0 )
if ( Q_strncmp( pszURL, "http://", 7 ) != 0 && Q_strncmp( pszURL, "https://", 8 ) != 0 && Q_stricmp( pszURL, "about:blank" ) != 0 )
{
Warning( "Blocking MOTD URL '%s'; must begin with 'http://' or 'https://'\n", pszURL );
Warning( "Blocking MOTD URL '%s'; must begin with 'http://' or 'https://' or be about:blank\n", pszURL );
keys->deleteThis();
return;
}

View File

@@ -1477,7 +1477,7 @@ void CDetailObjectSystem::LevelInitPreEntity()
PrecacheMaterial( DETAIL_SPRITE_MATERIAL );
IMaterial *pMat = m_DetailSpriteMaterial;
// adjust for non-square textures (cropped)
float flRatio = pMat->GetMappingWidth() / pMat->GetMappingHeight();
float flRatio = (float)( pMat->GetMappingWidth() ) / pMat->GetMappingHeight();
if ( flRatio > 1.0 )
{
for( int i = 0; i<m_DetailSpriteDict.Count(); i++ )

View File

@@ -18,7 +18,7 @@ class CFlashlightEffect
public:
CFlashlightEffect(int nEntIndex = 0);
~CFlashlightEffect();
virtual ~CFlashlightEffect();
virtual void UpdateLight(const Vector &vecPos, const Vector &vecDir, const Vector &vecRight, const Vector &vecUp, int nDistance);
void TurnOn();

View File

@@ -86,7 +86,6 @@ void CBuyMenu::ShowPanel(bool bShow)
void CBuyMenu::Update()
{
//Don't need to do anything, but do need to implement this function as base is pure virtual
NULL;
}
void CBuyMenu::OnClose()
{

View File

@@ -598,13 +598,13 @@ void CHudWeaponSelection::Paint()
// bucket style
int screenCenterX = (int) fCenterX;
int screenCenterY = (int) fCenterY - 15; // Height isn't quite screen height, so adjust for center alignement
int screenCenterY = (int) fCenterY - 15; // Height isn't quite screen height, so adjust for center alignment
// Modifiers for the four directions. Used to change the x and y offsets
// of each box based on which bucket we're drawing. Bucket directions are
// 0 = UP, 1 = RIGHT, 2 = DOWN, 3 = LEFT
int xModifiers[] = { 0, 1, 0, -1 };
int yModifiers[] = { -1, 0, 1, 0 };
int xModifiers[] = { 0, 1, 0, -1, -1, 1 };
int yModifiers[] = { -1, 0, 1, 0, 1, 1 };
// Draw the four buckets
for ( int i = 0; i < MAX_WEAPON_SLOTS; ++i )
@@ -1453,7 +1453,7 @@ void CHudWeaponSelection::SelectWeaponSlot( int iSlot )
return;
// Don't try and read past our possible number of slots
if ( iSlot > MAX_WEAPON_SLOTS )
if ( iSlot >= MAX_WEAPON_SLOTS )
return;
// Make sure the player's allowed to switch weapons

View File

@@ -512,7 +512,7 @@ void CHud::Shutdown( void )
//-----------------------------------------------------------------------------
// Purpose: LevelInit's called whenever a new level's starting
// Purpose: LevelInit's called whenever a new level is starting
//-----------------------------------------------------------------------------
void CHud::LevelInit( void )
{
@@ -533,11 +533,11 @@ void CHud::LevelInit( void )
}
//-----------------------------------------------------------------------------
// Purpose: LevelShutdown's called whenever a level's finishing
// Purpose: LevelShutdown's called whenever a level is finishing
//-----------------------------------------------------------------------------
void CHud::LevelShutdown( void )
{
// Tell all the registered hud elements to LevelInit
// Tell all the registered hud elements to LevelShutdown
for ( int i = 0; i < m_HudList.Size(); i++ )
{
m_HudList[i]->LevelShutdown();

View File

@@ -107,9 +107,9 @@ public:
void VidInit( void );
// Shutdown's called when the engine's shutting down
void Shutdown( void );
// LevelInit's called whenever a new level's starting
// LevelInit's called whenever a new level is starting
void LevelInit( void );
// LevelShutdown's called whenever a level's finishing
// LevelShutdown's called whenever a level is finishing
void LevelShutdown( void );
void ResetHUD( void );

View File

@@ -662,7 +662,8 @@ void CVoteSetupDialog::OnItemSelected( vgui::Panel *panel )
for ( int index = 0; index < m_VoteIssuesPopFiles.Count(); index++ )
{
// Don't show the current pop file
if ( TFObjectiveResource()->GetMvMPopFileName() == '\0' )
const char *pszPopFileName = TFObjectiveResource()->GetMvMPopFileName();
if ( !pszPopFileName || !pszPopFileName[0] )
{
// Use the map name
char szShortMapName[ MAX_MAP_NAME ];

View File

@@ -36,9 +36,9 @@ public:
// called whenever the video mode changes, and whenever Init() would be called, so the hud can vid init itself
virtual void VidInit( void ) { return; }
// LevelInit's called whenever a new level's starting
// LevelInit's called whenever a new level is starting
virtual void LevelInit( void ) { return; };
// LevelShutdown's called whenever a level's finishing
// LevelShutdown's called whenever a level is finishing
virtual void LevelShutdown( void ) { return; };
// called whenever the hud receives "reset" message, which is (usually) every time the client respawns after getting killed

View File

@@ -846,6 +846,8 @@ void CInput::JoyStickMove( float frametime, CUserCmd *cmd )
{
angle = m_flPreviousJoystickYaw * joy_yawsensitivity.GetFloat() * aspeed * 180.0;
}
angle = JoyStickAdjustYaw( angle );
viewangles[YAW] += angle;
cmd->mousedx = angle;

View File

@@ -141,6 +141,7 @@ private:
void ControllerMove ( float frametime, CUserCmd *cmd );
void JoyStickMove ( float frametime, CUserCmd *cmd );
float ScaleAxisValue( const float axisValue, const float axisThreshold );
virtual float JoyStickAdjustYaw( float flSpeed ) { return flSpeed; }
// Call this to get the cursor position. The call will be logged in the VCR file if there is one.
void GetMousePos(int &x, int &y);

View File

@@ -931,7 +931,8 @@ void CPrediction::SetIdealPitch ( C_BasePlayer *player, const Vector& origin, co
Vector top, bottom;
float floor_height[MAX_FORWARD];
int i, j;
int step, dir, steps;
float step, dir;
int steps;
trace_t tr;
if ( player->GetGroundEntity() == NULL )

View File

@@ -24,7 +24,7 @@
#include "confirm_dialog.h"
#include "replay/vgui/replaybrowserdetailspanel.h"
#include "base_gcmessages.h"
#include "base_gcmessages.pb.h"
#include "youtubeapi.h"
#include "steamworks_gamestats.h"

View File

@@ -879,10 +879,6 @@ bool SixenseGestureBindings::ActionTokenToStr( sixenseUtils::IButtonStates::Acti
{
Q_snprintf( buf, buflen, "tilt_gesture" );
}
else if( action == sixenseUtils::IButtonStates::ACTION_BUTTON_PRESS )
{
Q_snprintf( buf, buflen, "button_press" );
}
else if( action == sixenseUtils::IButtonStates::ACTION_TRIGGER_PRESS )
{
Q_snprintf( buf, buflen, "trigger_press" );

View File

@@ -189,12 +189,12 @@ void GetFPSColor( int nFps, unsigned char ucColor[3] )
if ( IsPC() && g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 95 )
{
nFPSThreshold1 = 60;
nFPSThreshold1 = 50;
nFPSThreshold2 = 50;
}
else if ( IsX360() || g_pMaterialSystemHardwareConfig->GetDXSupportLevel() >= 90 )
{
nFPSThreshold1 = 30;
nFPSThreshold1 = 25;
nFPSThreshold2 = 25;
}
if ( nFps >= nFPSThreshold1 )

View File

@@ -235,9 +235,10 @@ int CMessageCharsPanel::AddText(
Assert( !msg->text );
msg->text = new char[ Q_strlen( data ) + 1 ];
int textLength = Q_strlen( data ) + 1;
msg->text = new char[ textLength ];
Assert( msg->text );
Q_strncpy( msg->text, data, sizeof( msg->text ) );
Q_strncpy( msg->text, data, textLength );
if ( flTime )
msg->fTTL = gpGlobals->curtime + flTime;

View File

@@ -1885,7 +1885,8 @@ static void DrawPyroVignette( int nDestX, int nDestY, int nWidth, int nHeight, /
if ( pyro_vignette.GetInt() > 1 )
{
Vector2D vMaxSize( ( float )nScreenWidth / ( float )nScreenWidth / NUM_PYRO_SEGMENTS * 2.0f, ( float )nScreenHeight / ( float )nScreenHeight / NUM_PYRO_SEGMENTS * 2.0f );
float flPyroSegments = 2.0f / NUM_PYRO_SEGMENTS;
Vector2D vMaxSize( flPyroSegments, flPyroSegments );
if ( !bInit )
{

View File

@@ -2248,7 +2248,7 @@ void CViewRender::RenderView( const CViewSetup &view, int nClearFlags, int whatT
// let vgui know where to render stuff for the forced-to-framebuffer panels
if( UseVR() )
{
vgui::surface()->SetFullscreenViewportAndRenderTarget( viewFramebufferX, viewFramebufferY, viewFramebufferWidth, viewFramebufferHeight, saveRenderTarget );
g_pMatSystemSurface->SetFullscreenViewportAndRenderTarget( viewFramebufferX, viewFramebufferY, viewFramebufferWidth, viewFramebufferHeight, saveRenderTarget );
}
// clear the render target if we need to
@@ -3885,7 +3885,7 @@ static void DrawOpaqueRenderables_DrawStaticProps( CClientRenderablesList::CEntr
for( CClientRenderablesList::CEntry *itEntity = pEntitiesBegin; itEntity < pEntitiesEnd; ++ itEntity )
{
if ( itEntity->m_pRenderable )
NULL;
/**/;
else
continue;
@@ -3935,7 +3935,7 @@ void CRendering3dView::DrawOpaqueRenderables( ERenderDepthMode DepthMode )
RopeManager()->ResetRenderCache();
g_pParticleSystemMgr->ResetRenderCache();
bool const bDrawopaquestaticpropslast = r_drawopaquestaticpropslast.GetBool();
//bool const bDrawopaquestaticpropslast = r_drawopaquestaticpropslast.GetBool();
//
@@ -4101,16 +4101,20 @@ void CRendering3dView::DrawOpaqueRenderables( ERenderDepthMode DepthMode )
for ( int bucket = 0; bucket < RENDER_GROUP_CFG_NUM_OPAQUE_ENT_BUCKETS; ++ bucket )
{
if ( bDrawopaquestaticpropslast )
// PVS-Studio pointed out that the two sides of the if/else were identical. Fixing
// this long-broken behavior would change rendering, so I fixed the code but
// commented out the new behavior. Uncomment the if statement and else block
// when needed.
//if ( bDrawopaquestaticpropslast )
{
DrawOpaqueRenderables_Range( pEnts[bucket][0], pEnts[bucket][1], DepthMode );
DrawOpaqueRenderables_DrawStaticProps( pProps[bucket][0], pProps[bucket][1], DepthMode );
}
else
/*else
{
DrawOpaqueRenderables_Range( pEnts[bucket][0], pEnts[bucket][1], DepthMode );
DrawOpaqueRenderables_DrawStaticProps( pProps[bucket][0], pProps[bucket][1], DepthMode );
}
DrawOpaqueRenderables_Range( pEnts[bucket][0], pEnts[bucket][1], DepthMode );
}*/
}

View File

@@ -8,10 +8,10 @@ $MacroRequired "PLATFORM"
$Project
{
$Folder "Libraries"
$Folder "Link Libraries"
{
$Libexternal libprotobuf [!$VS2012 && !$VS2013]
$Libexternal $SRCDIR\lib\public\2010\libprotobuf [$VS2010]
$Libexternal 2012\libprotobuf [$VS2012]
$Libexternal 2013\libprotobuf [$VS2013]
$Libexternal libprotobuf [$VS2013 || !$WINDOWS]
}
}

View File

@@ -104,9 +104,14 @@ void CAnimationLayer::Init( CBaseAnimatingOverlay *pOverlay )
m_nSequence = 0;
m_nPriority = 0;
m_nOrder.Set( CBaseAnimatingOverlay::MAX_OVERLAYS );
m_flBlendIn = 0.0;
m_flBlendOut = 0.0;
m_flKillRate = 100.0;
m_flKillDelay = 0.0;
m_flPlaybackRate = 1.0;
m_flLastEventCheck = 0.0;
m_flLastAccess = gpGlobals->curtime;
m_flLayerAnimtime = 0;
m_flLayerFadeOuttime = 0;

View File

@@ -95,7 +95,7 @@ void CEnvFade::InputFade( inputdata_t &inputdata )
if ( m_spawnflags & SF_FADE_ONLYONE )
{
if ( inputdata.pActivator->IsNetClient() )
if ( inputdata.pActivator && inputdata.pActivator->IsNetClient() )
{
UTIL_ScreenFade( inputdata.pActivator, m_clrRender, Duration(), HoldTime(), fadeFlags );
}

View File

@@ -46,7 +46,7 @@ END_DATADESC()
CAI_ShotRegulator::CAI_ShotRegulator() : m_nMinBurstShots(1), m_nMaxBurstShots(1)
{
m_flMinRestInterval = 0.0f;
m_flMinRestInterval = 0.0f;
m_flMaxRestInterval = 0.0f;
m_flMinBurstInterval = 0.0f;
m_flMaxBurstInterval = 0.0f;
m_flNextShotTime = -1;

View File

@@ -303,7 +303,7 @@ IMPLEMENT_SERVERCLASS_ST_NOBASE( CBaseEntity, DT_BaseEntity )
SendPropBool( SENDINFO( m_bAlternateSorting )),
#ifdef TF_DLL
SendPropArray3( SENDINFO_ARRAY3(m_nModelIndexOverrides), SendPropInt( SENDINFO_ARRAY(m_nModelIndexOverrides), SP_MODEL_INDEX_BITS, SPROP_UNSIGNED ) ),
SendPropArray3( SENDINFO_ARRAY3(m_nModelIndexOverrides), SendPropInt( SENDINFO_ARRAY(m_nModelIndexOverrides), SP_MODEL_INDEX_BITS, 0 ) ),
#endif
END_SEND_TABLE()

View File

@@ -1318,9 +1318,9 @@ static Activity DetermineExpressionMoveActivity( CChoreoEvent *event, CAI_BaseNP
// Custom distance styles are appended to param2 with a space as a separator
const char *pszAct = Q_strstr( sParam2, " " );
char szActName[256];
if ( pszAct )
{
char szActName[256];
Q_strncpy( szActName, sParam2, sizeof(szActName) );
szActName[ (pszAct-sParam2) ] = '\0';
pszAct = szActName;

View File

@@ -169,7 +169,7 @@ void CEnvTonemapController::InputSetBloomScaleRange( inputdata_t &inputdata )
return;
}
m_flCustomBloomScale=bloom_max;
m_flCustomBloomScale=bloom_min;
m_flCustomBloomScaleMinimum=bloom_min;
}
//-----------------------------------------------------------------------------

View File

@@ -1888,9 +1888,13 @@ void CServerGameDLL::SetServerHibernation( bool bHibernating )
const char *CServerGameDLL::GetServerBrowserMapOverride()
{
#ifdef TF_DLL
if ( TFGameRules() && TFGameRules()->IsMannVsMachineMode() && g_pPopulationManager && g_pPopulationManager->GetPopulationFilenameShort() != '\0' )
if ( TFGameRules() && TFGameRules()->IsMannVsMachineMode() )
{
return g_pPopulationManager->GetPopulationFilenameShort();
const char *pszFilenameShort = g_pPopulationManager ? g_pPopulationManager->GetPopulationFilenameShort() : NULL;
if ( pszFilenameShort && pszFilenameShort[0] )
{
return pszFilenameShort;
}
}
#endif
return NULL;
@@ -2964,17 +2968,20 @@ void CServerGameClients::ClientSetupVisibility( edict_t *pViewEntity, edict_t *p
// Flush the remaining areaportal states.
engine->SetAreaPortalStates( portalNums, isOpen, iOutPortal );
// Update the area bits that get sent to the client.
pPlayer->m_Local.UpdateAreaBits( pPlayer, portalBits );
if ( pPlayer )
{
// Update the area bits that get sent to the client.
pPlayer->m_Local.UpdateAreaBits( pPlayer, portalBits );
#ifdef PORTAL
// *After* the player's view has updated its area bits, add on any other areas seen by portals
CPortal_Player* pPortalPlayer = dynamic_cast<CPortal_Player*>( pPlayer );
if ( pPortalPlayer )
{
pPortalPlayer->UpdatePortalViewAreaBits( pvs, pvssize );
}
// *After* the player's view has updated its area bits, add on any other areas seen by portals
CPortal_Player* pPortalPlayer = dynamic_cast<CPortal_Player*>( pPlayer );
if ( pPortalPlayer )
{
pPortalPlayer->UpdatePortalViewAreaBits( pvs, pvssize );
}
#endif //PORTAL
}
}

View File

@@ -1130,7 +1130,7 @@ void CNPC_Strider::GatherConditions()
!WeaponLOSCondition( GetAdjustedOrigin(), GetEnemy()->BodyTarget( GetAdjustedOrigin() ), false ) ) )
{
#if 0
if ( !HasCondition( COND_STRIDER_SHOULD_CROUCH ) && !HasCondition( COND_STRIDER_SHOULD_CROUCH ) )
if ( !HasCondition( COND_STRIDER_SHOULD_CROUCH ) )
SetIdealHeight( MIN( GetMaxHeight(), GetHeight() + 75.0 * 0.1 ) ); // default to rising up
#endif
GatherHeightConditions( GetAdjustedOrigin(), GetEnemy() );
@@ -1161,7 +1161,7 @@ void CNPC_Strider::GatherConditions()
//---------------------------------------------------------
void CNPC_Strider::GatherHeightConditions( const Vector &vTestPos, CBaseEntity *pEntity )
{
if ( HasCondition( COND_STRIDER_SHOULD_CROUCH ) && HasCondition( COND_STRIDER_SHOULD_CROUCH ) )
if ( HasCondition( COND_STRIDER_SHOULD_CROUCH ) )
return;
float maxZ = (GetAbsOrigin().z - (GetMaxHeightModel() - GetMaxHeight()));

View File

@@ -7409,6 +7409,13 @@ void CBasePlayer::RemoveWearable( CEconWearable *pItem )
m_hMyWearables.Remove( i );
break;
}
// Integrety is failing, remove NULLs
if ( !pWearable )
{
m_hMyWearables.Remove( i );
break;
}
}
#ifdef DEBUG

View File

@@ -1517,7 +1517,7 @@ void CBreakableProp::OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t Rea
SetPhysicsAttacker( pPhysGunUser, gpGlobals->curtime );
if( Reason == PUNTED_BY_CANNON )
if( (int)Reason == (int)PUNTED_BY_CANNON )
{
PlayPuntSound();
}

View File

@@ -358,16 +358,21 @@ void CMultiPlayerAnimState::PlayFlinchGesture( Activity iActivity )
//-----------------------------------------------------------------------------
bool CMultiPlayerAnimState::InitGestureSlots( void )
{
// Get the base player.
CBasePlayer *pPlayer = GetBasePlayer();
if( pPlayer )
// Setup the number of gesture slots.
m_aGestureSlots.AddMultipleToTail( GESTURE_SLOT_COUNT );
// Assign all of the the CAnimationLayer pointers to null early in case we bail.
for ( int iGesture = 0; iGesture < GESTURE_SLOT_COUNT; ++iGesture )
{
// Set the number of animation overlays we will use.
pPlayer->SetNumAnimOverlays( GESTURE_SLOT_COUNT );
m_aGestureSlots[iGesture].m_pAnimLayer = NULL;
}
// Setup the number of gesture slots.
m_aGestureSlots.AddMultipleToTail( GESTURE_SLOT_COUNT );
// Get the base player.
CBasePlayer *pPlayer = GetBasePlayer();
// Set the number of animation overlays we will use.
pPlayer->SetNumAnimOverlays( GESTURE_SLOT_COUNT );
for ( int iGesture = 0; iGesture < GESTURE_SLOT_COUNT; ++iGesture )
{
m_aGestureSlots[iGesture].m_pAnimLayer = pPlayer->GetAnimOverlay( iGesture );
@@ -409,6 +414,9 @@ void CMultiPlayerAnimState::ResetGestureSlot( int iGestureSlot )
// Sanity Check
Assert( iGestureSlot >= 0 && iGestureSlot < GESTURE_SLOT_COUNT );
if ( !VerifyAnimLayerInSlot( iGestureSlot ) )
return;
GestureSlot_t *pGestureSlot = &m_aGestureSlots[iGestureSlot];
if ( pGestureSlot )
{
@@ -486,6 +494,36 @@ bool CMultiPlayerAnimState::IsGestureSlotActive( int iGestureSlot )
return m_aGestureSlots[iGestureSlot].m_bActive;
}
//-----------------------------------------------------------------------------
// Purpose: Track down a crash
//-----------------------------------------------------------------------------
bool CMultiPlayerAnimState::VerifyAnimLayerInSlot( int iGestureSlot )
{
if ( iGestureSlot < 0 || iGestureSlot >= GESTURE_SLOT_COUNT )
{
return false;
}
if ( GetBasePlayer()->GetNumAnimOverlays() < iGestureSlot + 1 )
{
AssertMsg2( false, "Player %d doesn't have gesture slot %d any more.", GetBasePlayer()->entindex(), iGestureSlot );
Msg( "Player %d doesn't have gesture slot %d any more.\n", GetBasePlayer()->entindex(), iGestureSlot );
m_aGestureSlots[iGestureSlot].m_pAnimLayer = NULL;
return false;
}
CAnimationLayer *pExpected = GetBasePlayer()->GetAnimOverlay( iGestureSlot );
if ( m_aGestureSlots[iGestureSlot].m_pAnimLayer != pExpected )
{
AssertMsg3( false, "Gesture slot %d pointing to wrong address %p. Updating to new address %p.", iGestureSlot, m_aGestureSlots[iGestureSlot].m_pAnimLayer, pExpected );
Msg( "Gesture slot %d pointing to wrong address %p. Updating to new address %p.\n", iGestureSlot, m_aGestureSlots[iGestureSlot].m_pAnimLayer, pExpected );
m_aGestureSlots[iGestureSlot].m_pAnimLayer = pExpected;
}
return true;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
@@ -509,6 +547,9 @@ void CMultiPlayerAnimState::RestartGesture( int iGestureSlot, Activity iGestureA
// Sanity Check
Assert( iGestureSlot >= 0 && iGestureSlot < GESTURE_SLOT_COUNT );
if ( !VerifyAnimLayerInSlot( iGestureSlot ) )
return;
if ( !IsGestureSlotPlaying( iGestureSlot, iGestureActivity ) )
{
#ifdef CLIENT_DLL
@@ -549,6 +590,9 @@ void CMultiPlayerAnimState::AddToGestureSlot( int iGestureSlot, Activity iGestur
if ( !m_aGestureSlots[iGestureSlot].m_pAnimLayer )
return;
if ( !VerifyAnimLayerInSlot( iGestureSlot ) )
return;
// Get the sequence.
int iGestureSequence = pPlayer->SelectWeightedSequence( iGestureActivity );
if ( iGestureSequence <= 0 )
@@ -623,6 +667,9 @@ void CMultiPlayerAnimState::AddVCDSequenceToGestureSlot( int iGestureSlot, int i
if ( !m_aGestureSlots[iGestureSlot].m_pAnimLayer )
return;
if ( !VerifyAnimLayerInSlot( iGestureSlot ) )
return;
// Set the activity.
Activity iGestureActivity = ACT_MP_VCD;
@@ -1154,6 +1201,9 @@ void CMultiPlayerAnimState::ComputeGestureSequence( CStudioHdr *pStudioHdr )
if ( !m_aGestureSlots[iGesture].m_bActive )
continue;
if ( !VerifyAnimLayerInSlot( iGesture ) )
continue;
UpdateGestureLayer( pStudioHdr, &m_aGestureSlots[iGesture] );
}
}

View File

@@ -200,6 +200,7 @@ public:
void AddVCDSequenceToGestureSlot( int iGestureSlot, int iGestureSequence, float flCycle = 0.0f, bool bAutoKill = true );
CAnimationLayer* GetGestureSlotLayer( int iGestureSlot );
bool IsGestureSlotActive( int iGestureSlot );
bool VerifyAnimLayerInSlot( int iGestureSlot );
// Feet.
bool m_bForceAimYaw;

View File

@@ -65,7 +65,7 @@ CBasePlayerAnimState::CBasePlayerAnimState()
m_flEyePitch = 0.0f;
m_bCurrentFeetYawInitialized = false;
m_flCurrentTorsoYaw = 0.0f;
m_flCurrentTorsoYaw = TURN_NONE;
m_nTurningInPlace = TURN_NONE;
m_flMaxGroundSpeed = 0.0f;
m_flStoredCycle = 0.0f;

View File

@@ -427,13 +427,7 @@ void CBaseAchievement::EnsureComponentBitSetAndEvaluate( int iBitNumber )
// new component, set the bit and increment the count
SetComponentBits( m_iComponentBits | iBitMask );
Assert( m_iCount <= m_iGoal );
if ( m_iCount == m_iGoal )
{
// all components found, award the achievement (and save state)
AwardAchievement();
}
else
if ( m_iCount != m_iGoal )
{
// save our state at the next good opportunity
m_pAchievementMgr->SetDirty( true );
@@ -453,6 +447,15 @@ void CBaseAchievement::EnsureComponentBitSetAndEvaluate( int iBitNumber )
Msg( "Component %d for achievement %s found, but already had that component\n", iBitNumber, GetName() );
}
}
// Check to see if we've achieved our goal even if the bit is already set
// (this fixes some older achievements that are stuck in the 9/9 state and could never be evaluated)
Assert( m_iCount <= m_iGoal );
if ( m_iCount == m_iGoal )
{
// all components found, award the achievement (and save state)
AwardAchievement();
}
}
//-----------------------------------------------------------------------------

View File

@@ -105,6 +105,9 @@ public:
virtual void Think( void ) { return; }
const char *GetMapNameFilter( void ){ return m_pMapNameFilter; }
CAchievementMgr *GetAchievementMgr( void ){ return m_pAchievementMgr; }
protected:
virtual void FireGameEvent( IGameEvent *event );
virtual void FireGameEvent_Internal( IGameEvent *event ) {};

View File

@@ -857,9 +857,9 @@ ConVarRef suitcharger( "sk_suitcharger" );
{
killer_weapon_name += 7;
}
else if ( strncmp( killer_weapon_name, "NPC_", 8 ) == 0 )
else if ( strncmp( killer_weapon_name, "NPC_", 4 ) == 0 )
{
killer_weapon_name += 8;
killer_weapon_name += 4;
}
else if ( strncmp( killer_weapon_name, "func_", 5 ) == 0 )
{

View File

@@ -309,7 +309,7 @@ void DispatchParticleEffect( const char *pszParticleName, ParticleAttachment_t i
if ( ( data.m_fFlags & PARTICLE_DISPATCH_FROM_ENTITY ) != 0 &&
( iAttachType == PATTACH_ABSORIGIN_FOLLOW || iAttachType == PATTACH_POINT_FOLLOW || iAttachType == PATTACH_ROOTBONE_FOLLOW ) )
{
CReliableBroadcastRecipientFilter filter;
CBroadcastRecipientFilter filter;
DispatchEffect( "ParticleEffect", data, filter );
}
else

View File

@@ -200,8 +200,23 @@ void CParticleProperty::AddControlPoint( int iEffectIndex, int iPoint, C_BaseEnt
ParticleEffectList_t *pEffect = &m_ParticleEffects[iEffectIndex];
Assert( pEffect->pControlPoints.Count() < MAX_PARTICLE_CONTROL_POINTS );
int iIndex = pEffect->pControlPoints.AddToTail();
ParticleControlPoint_t *pNewPoint = &pEffect->pControlPoints[iIndex];
// If the control point is already used, override it
ParticleControlPoint_t *pNewPoint = NULL;
int iIndex = iPoint;
FOR_EACH_VEC( pEffect->pControlPoints, i )
{
if ( pEffect->pControlPoints[i].iControlPoint == iPoint )
{
pNewPoint = &pEffect->pControlPoints[i];
}
}
if ( !pNewPoint )
{
iIndex = pEffect->pControlPoints.AddToTail();
pNewPoint = &pEffect->pControlPoints[iIndex];
}
pNewPoint->iControlPoint = iPoint;
pNewPoint->hEntity = pEntity;
pNewPoint->iAttachType = iAttachType;
@@ -553,7 +568,7 @@ void CParticleProperty::UpdateControlPoint( ParticleEffectList_t *pEffect, int i
if ( pAnimating )
{
int bUseHeadOrigin = 0;
CALL_ATTRIB_HOOK_INT_ON_OTHER( pPoint->hEntity.Get(), bUseHeadOrigin, particle_effect_use_head_origin );
CALL_ATTRIB_HOOK_INT_ON_OTHER( pAnimating, bUseHeadOrigin, particle_effect_use_head_origin );
if ( bUseHeadOrigin > 0 )
{
int iBone = Studio_BoneIndexByName( pAnimating->GetModelPtr(), "bip_head" );
@@ -565,15 +580,17 @@ void CParticleProperty::UpdateControlPoint( ParticleEffectList_t *pEffect, int i
iBone = Studio_BoneIndexByName( pAnimating->GetModelPtr(), "prp_hat" );
}
}
if ( iBone >= 0 )
if ( iBone < 0 )
{
bUsingHeadOrigin = true;
const matrix3x4_t headBone = pAnimating->GetBone( iBone );
MatrixVectors( headBone, &vecForward, &vecRight, &vecUp );
MatrixPosition( headBone, vecOrigin );
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pPoint->hEntity.Get(), flOffset, particle_effect_vertical_offset );
iBone = 0;
}
bUsingHeadOrigin = true;
const matrix3x4_t headBone = pAnimating->GetBone( iBone );
MatrixVectors( headBone, &vecForward, &vecRight, &vecUp );
MatrixPosition( headBone, vecOrigin );
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pAnimating, flOffset, particle_effect_vertical_offset );
}
}
}