diff options
| author | Michael Sartain <[email protected]> | 2014-10-02 08:25:55 -0700 |
|---|---|---|
| committer | Michael Sartain <[email protected]> | 2014-10-02 08:25:55 -0700 |
| commit | 55ed12f8d1eb6887d348be03aee5573d44177ffb (patch) | |
| tree | 3686f7ca78c780cd9a3d367b79a9d9250c1be7c0 /mp/src/game/shared | |
| parent | * Added support for Visual C++ 2013 Express to VPC (diff) | |
| download | source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.tar.xz source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.zip | |
Updated the SDK with the latest code from the TF and HL2 branches.
Diffstat (limited to 'mp/src/game/shared')
36 files changed, 401 insertions, 55 deletions
diff --git a/mp/src/game/shared/GameStats.cpp b/mp/src/game/shared/GameStats.cpp index 695dc553..d01e56fb 100644 --- a/mp/src/game/shared/GameStats.cpp +++ b/mp/src/game/shared/GameStats.cpp @@ -1199,6 +1199,7 @@ void CBaseGameStats_Driver::ResetData() pKV->SetInt( "Height", dest_height ); const MaterialSystem_Config_t &config = materials->GetCurrentConfigForVideoCard(); pKV->SetInt( "Windowed", config.Windowed() == true ); + pKV->SetInt( "MaxDxLevel", g_pMaterialSystemHardwareConfig->GetMaxDXSupportLevel() ); engine->SetGamestatsData( m_pGamestatsData ); #endif diff --git a/mp/src/game/shared/SoundEmitterSystem.cpp b/mp/src/game/shared/SoundEmitterSystem.cpp index 6d27fde9..7b641c20 100644 --- a/mp/src/game/shared/SoundEmitterSystem.cpp +++ b/mp/src/game/shared/SoundEmitterSystem.cpp @@ -465,7 +465,6 @@ public: { return; } -#endif // STAGING_ONLY if ( !Q_strncasecmp( params.soundname, "vo", 2 ) && !( params.channel == CHAN_STREAM || @@ -475,6 +474,7 @@ public: DevMsg( "EmitSound: Voice wave file %s doesn't specify CHAN_VOICE, CHAN_VOICE2 or CHAN_STREAM for sound %s\n", params.soundname, ep.m_pSoundName ); } +#endif // STAGING_ONLY // handle SND_CHANGEPITCH/SND_CHANGEVOL and other sound flags.etc. if( ep.m_nFlags & SND_CHANGE_PITCH ) diff --git a/mp/src/game/shared/activitylist.cpp b/mp/src/game/shared/activitylist.cpp index 2b421252..4c882d47 100644 --- a/mp/src/game/shared/activitylist.cpp +++ b/mp/src/game/shared/activitylist.cpp @@ -2275,6 +2275,35 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY( ACT_SPELL_VM_ARM ); REGISTER_SHARED_ACTIVITY( ACT_SPELL_VM_FIRE ); + REGISTER_SHARED_ACTIVITY( ACT_BREADSAPPER_VM_DRAW ); + REGISTER_SHARED_ACTIVITY( ACT_BREADSAPPER_VM_IDLE ); + + REGISTER_SHARED_ACTIVITY( ACT_BREADGLOVES_VM_HITLEFT ); + REGISTER_SHARED_ACTIVITY( ACT_BREADGLOVES_VM_HITRIGHT ); + REGISTER_SHARED_ACTIVITY( ACT_BREADGLOVES_VM_SWINGHARD ); + REGISTER_SHARED_ACTIVITY( ACT_BREADGLOVES_VM_IDLE ); + REGISTER_SHARED_ACTIVITY( ACT_BREADGLOVES_VM_DRAW ); + + REGISTER_SHARED_ACTIVITY( ACT_BREADMONSTER_GLOVES_IDLE ); + REGISTER_SHARED_ACTIVITY( ACT_BREADMONSTER_GLOVES_HITRIGHT ); + REGISTER_SHARED_ACTIVITY( ACT_BREADMONSTER_GLOVES_HITUP ); + + REGISTER_SHARED_ACTIVITY( ACT_BREADMONSTER_VM_DRAW ); + REGISTER_SHARED_ACTIVITY( ACT_BREADMONSTER_VM_IDLE ); + REGISTER_SHARED_ACTIVITY( ACT_BREADMONSTER_VM_PRIMARYATTACK ); + + REGISTER_SHARED_ACTIVITY( ACT_PARACHUTE_DEPLOY ); + REGISTER_SHARED_ACTIVITY( ACT_PARACHUTE_DEPLOY_IDLE ); + REGISTER_SHARED_ACTIVITY( ACT_PARACHUTE_RETRACT ); + REGISTER_SHARED_ACTIVITY( ACT_PARACHUTE_RETRACT_IDLE ); + + REGISTER_SHARED_ACTIVITY( ACT_BOT_SPAWN ); + REGISTER_SHARED_ACTIVITY( ACT_BOT_PANIC ); + REGISTER_SHARED_ACTIVITY( ACT_BOT_PRIMARY_MOVEMENT ); + REGISTER_SHARED_ACTIVITY( ACT_BOT_GESTURE_FLINCH ); + REGISTER_SHARED_ACTIVITY( ACT_BOT_PANIC_START ); + REGISTER_SHARED_ACTIVITY( ACT_BOT_PANIC_END ); + AssertMsg( g_HighestActivity == LAST_SHARED_ACTIVITY - 1, "Not all activities from ai_activity.h registered in activitylist.cpp" ); } diff --git a/mp/src/game/shared/ai_activity.h b/mp/src/game/shared/ai_activity.h index fbd10c39..3d3207c9 100644 --- a/mp/src/game/shared/ai_activity.h +++ b/mp/src/game/shared/ai_activity.h @@ -2107,6 +2107,37 @@ typedef enum ACT_SPELL_VM_ARM, ACT_SPELL_VM_FIRE, + // Bread Monster Sapper + ACT_BREADSAPPER_VM_DRAW, + ACT_BREADSAPPER_VM_IDLE, + + // Bread Gloves + ACT_BREADGLOVES_VM_HITLEFT, + ACT_BREADGLOVES_VM_HITRIGHT, + ACT_BREADGLOVES_VM_SWINGHARD, + ACT_BREADGLOVES_VM_IDLE, + ACT_BREADGLOVES_VM_DRAW, + + ACT_BREADMONSTER_GLOVES_IDLE, + ACT_BREADMONSTER_GLOVES_HITRIGHT, + ACT_BREADMONSTER_GLOVES_HITUP, + + ACT_BREADMONSTER_VM_DRAW, + ACT_BREADMONSTER_VM_IDLE, + ACT_BREADMONSTER_VM_PRIMARYATTACK, + + ACT_PARACHUTE_DEPLOY, + ACT_PARACHUTE_DEPLOY_IDLE, + ACT_PARACHUTE_RETRACT, + ACT_PARACHUTE_RETRACT_IDLE, + + ACT_BOT_SPAWN, + ACT_BOT_PANIC, + ACT_BOT_PRIMARY_MOVEMENT, + ACT_BOT_GESTURE_FLINCH, + ACT_BOT_PANIC_START, + ACT_BOT_PANIC_END, + // this is the end of the global activities, private per-monster activities start here. LAST_SHARED_ACTIVITY, } Activity; diff --git a/mp/src/game/shared/apparent_velocity_helper.h b/mp/src/game/shared/apparent_velocity_helper.h index 765a419d..65e28fbd 100644 --- a/mp/src/game/shared/apparent_velocity_helper.h +++ b/mp/src/game/shared/apparent_velocity_helper.h @@ -46,9 +46,10 @@ template< class T, class Functor=CDefaultCalcDistance<T> > class CApparentVelocity { public: - CApparentVelocity() + CApparentVelocity(const T& t0) { m_LastTime = -1; + m_LastValue = t0; } float AddSample( float time, T value ) diff --git a/mp/src/game/shared/basecombatweapon_shared.cpp b/mp/src/game/shared/basecombatweapon_shared.cpp index 754919d3..4ab20c12 100644 --- a/mp/src/game/shared/basecombatweapon_shared.cpp +++ b/mp/src/game/shared/basecombatweapon_shared.cpp @@ -38,6 +38,8 @@ #endif +#include "vprof.h" + // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" @@ -164,8 +166,20 @@ void CBaseCombatWeapon::GiveDefaultAmmo( void ) //----------------------------------------------------------------------------- void CBaseCombatWeapon::Spawn( void ) { + bool bPrecacheAllowed = CBaseEntity::IsPrecacheAllowed(); + if (!bPrecacheAllowed) + { + tmEnter( TELEMETRY_LEVEL1, TMZF_NONE, "LateWeaponPrecache" ); + } + Precache(); + if (!bPrecacheAllowed) + { + tmLeave( TELEMETRY_LEVEL1 ); + } + + BaseClass::Spawn(); SetSolid( SOLID_BBOX ); @@ -1643,6 +1657,11 @@ void CBaseCombatWeapon::ItemPreFrame( void ) #endif } +bool CBaseCombatWeapon::CanPerformSecondaryAttack() const +{ + return m_flNextSecondaryAttack <= gpGlobals->curtime; +} + //==================================================================================== // WEAPON BEHAVIOUR //==================================================================================== @@ -1667,7 +1686,7 @@ void CBaseCombatWeapon::ItemPostFrame( void ) bool bFired = false; // Secondary attack has priority - if ((pOwner->m_nButtons & IN_ATTACK2) && (m_flNextSecondaryAttack <= gpGlobals->curtime)) + if ((pOwner->m_nButtons & IN_ATTACK2) && CanPerformSecondaryAttack() ) { if (UsesSecondaryAmmo() && pOwner->GetAmmoCount(m_iSecondaryAmmoType)<=0 ) { diff --git a/mp/src/game/shared/basecombatweapon_shared.h b/mp/src/game/shared/basecombatweapon_shared.h index 701403a0..2c712923 100644 --- a/mp/src/game/shared/basecombatweapon_shared.h +++ b/mp/src/game/shared/basecombatweapon_shared.h @@ -247,6 +247,7 @@ public: virtual void HandleFireOnEmpty(); // Called when they have the attack button down // but they are out of ammo. The default implementation // either reloads, switches weapons, or plays an empty sound. + virtual bool CanPerformSecondaryAttack() const; virtual bool ShouldBlockPrimaryFire() { return false; } diff --git a/mp/src/game/shared/baseentity_shared.cpp b/mp/src/game/shared/baseentity_shared.cpp index 43348cb1..a843543f 100644 --- a/mp/src/game/shared/baseentity_shared.cpp +++ b/mp/src/game/shared/baseentity_shared.cpp @@ -2250,6 +2250,15 @@ int CBaseEntity::GetTracerAttachment( void ) return iAttachment; } +float CBaseEntity::HealthFraction() const +{ + if ( GetMaxHealth() == 0 ) + return 1.0f; + + float flFraction = ( float )GetHealth() / ( float )GetMaxHealth(); + flFraction = clamp( flFraction, 0.0f, 1.0f ); + return flFraction; +} int CBaseEntity::BloodColor() { diff --git a/mp/src/game/shared/baseprojectile.cpp b/mp/src/game/shared/baseprojectile.cpp index c695db93..54a0e9bc 100644 --- a/mp/src/game/shared/baseprojectile.cpp +++ b/mp/src/game/shared/baseprojectile.cpp @@ -12,6 +12,11 @@ IMPLEMENT_NETWORKCLASS_ALIASED( BaseProjectile, DT_BaseProjectile ) BEGIN_NETWORK_TABLE( CBaseProjectile, DT_BaseProjectile ) +#if !defined( CLIENT_DLL ) + SendPropEHandle( SENDINFO( m_hOriginalLauncher ) ), +#else + RecvPropEHandle( RECVINFO( m_hOriginalLauncher ) ), +#endif // CLIENT_DLL END_NETWORK_TABLE() @@ -22,5 +27,63 @@ CBaseProjectile::CBaseProjectile() { #ifdef GAME_DLL m_iDestroyableHitCount = 0; + + m_bCanCollideWithTeammates = false; #endif + m_hOriginalLauncher = NULL; +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CBaseProjectile::SetLauncher( CBaseEntity *pLauncher ) +{ + if ( m_hOriginalLauncher == NULL ) + { + m_hOriginalLauncher = pLauncher; + } + +#ifdef GAME_DLL + ResetCollideWithTeammates(); +#endif // GAME_DLL +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CBaseProjectile::Spawn() +{ + BaseClass::Spawn(); + +#ifdef GAME_DLL + ResetCollideWithTeammates(); +#endif // GAME_DLL } + + +#ifdef GAME_DLL + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CBaseProjectile::CollideWithTeammatesThink() +{ + m_bCanCollideWithTeammates = true; +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +void CBaseProjectile::ResetCollideWithTeammates() +{ + // Don't collide with players on the owner's team for the first bit of our life + m_bCanCollideWithTeammates = false; + + SetContextThink( &CBaseProjectile::CollideWithTeammatesThink, gpGlobals->curtime + GetCollideWithTeammatesDelay(), "CollideWithTeammates" ); +} + +#endif // GAME_DLL + diff --git a/mp/src/game/shared/baseprojectile.h b/mp/src/game/shared/baseprojectile.h index 2ff00fc5..d87b9fdd 100644 --- a/mp/src/game/shared/baseprojectile.h +++ b/mp/src/game/shared/baseprojectile.h @@ -36,18 +36,37 @@ public: CBaseProjectile(); + virtual void Spawn(); + #ifdef GAME_DLL virtual int GetDestroyableHitCount( void ) const { return m_iDestroyableHitCount; } void IncrementDestroyableHitCount( void ) { ++m_iDestroyableHitCount; } + + bool CanCollideWithTeammates() const { return m_bCanCollideWithTeammates; } + virtual float GetCollideWithTeammatesDelay() const { return 0.25f; } #endif // GAME_DLL virtual bool IsDestroyable( void ) { return false; } virtual void Destroy( bool bBlinkOut = true, bool bBreakRocket = false ) {} + virtual void SetLauncher( CBaseEntity *pLauncher ); + CBaseEntity *GetOriginalLauncher() const { return m_hOriginalLauncher; } protected: #ifdef GAME_DLL + void CollideWithTeammatesThink(); + int m_iDestroyableHitCount; #endif // GAME_DLL + +private: + +#ifdef GAME_DLL + void ResetCollideWithTeammates(); + + bool m_bCanCollideWithTeammates; +#endif // GAME_DLL + + CNetworkHandle( CBaseEntity, m_hOriginalLauncher ); }; #endif // BASEPROJECTILE_H diff --git a/mp/src/game/shared/choreoevent.cpp b/mp/src/game/shared/choreoevent.cpp index 50755f04..9afb938b 100644 --- a/mp/src/game/shared/choreoevent.cpp +++ b/mp/src/game/shared/choreoevent.cpp @@ -2076,8 +2076,8 @@ public: { if ( ARRAYSIZE( g_NameMap ) != CChoreoEvent::NUM_TYPES ) { - Error( "g_NameMap contains %i entries, CChoreoEvent::NUM_TYPES == %i!", - ARRAYSIZE( g_NameMap ), CChoreoEvent::NUM_TYPES ); + Error( "g_NameMap contains %llu entries, CChoreoEvent::NUM_TYPES == %i!", + (uint64)(ARRAYSIZE( g_NameMap )), CChoreoEvent::NUM_TYPES ); } for ( int i = 0; i < CChoreoEvent::NUM_TYPES; ++i ) { @@ -2158,8 +2158,8 @@ public: { if ( ARRAYSIZE( g_CCNameMap ) != CChoreoEvent::NUM_CC_TYPES ) { - Error( "g_CCNameMap contains %i entries, CChoreoEvent::NUM_CC_TYPES == %i!", - ARRAYSIZE( g_CCNameMap ), CChoreoEvent::NUM_CC_TYPES ); + Error( "g_CCNameMap contains %llu entries, CChoreoEvent::NUM_CC_TYPES == %i!", + (uint64)(ARRAYSIZE( g_CCNameMap )), CChoreoEvent::NUM_CC_TYPES ); } for ( int i = 0; i < CChoreoEvent::NUM_CC_TYPES; ++i ) { diff --git a/mp/src/game/shared/choreoscene.cpp b/mp/src/game/shared/choreoscene.cpp index 734e89be..b77c94b8 100644 --- a/mp/src/game/shared/choreoscene.cpp +++ b/mp/src/game/shared/choreoscene.cpp @@ -156,6 +156,7 @@ CChoreoScene& CChoreoScene::operator=( const CChoreoScene& src ) m_pTokenizer = src.m_pTokenizer; m_flCurrentTime = src.m_flCurrentTime; + m_flStartLoopTime = src.m_flStartLoopTime; m_flStartTime = src.m_flStartTime; m_flEndTime = src.m_flEndTime; m_flSoundSystemLatency = src.m_flSoundSystemLatency; @@ -234,6 +235,7 @@ void CChoreoScene::Init( IChoreoEventCallback *callback ) m_szMapname[ 0 ] = 0; m_flCurrentTime = 0.0f; + m_flStartLoopTime = -1.f; m_flStartTime = 0.0f; m_flEndTime = 0.0f; m_flSoundSystemLatency = 0.0f; @@ -2312,6 +2314,8 @@ void CChoreoScene::ResetSimulation( bool forward /*= true*/, float starttime /*= m_flCurrentTime = forward ? m_flEarliestTime : m_flLatestTime; + m_flStartLoopTime = -1.f; + // choreoprintf( 0, "Start time %f\n", m_flCurrentTime ); m_flLastActiveTime = 0.0f; @@ -2473,6 +2477,15 @@ int CChoreoScene::EventThink( CChoreoEvent *e, float frame_start_time, float fra } } */ + + if ( !suppressed ) + { + // if this SPEAK event starts before the beginning of the current loop, don't play the SPEAK event again in the loop + if ( m_flStartLoopTime >= 0.f && starttime < m_flStartLoopTime ) + { + return iret; + } + } } break; case CChoreoEvent::SUBSCENE: @@ -2836,6 +2849,8 @@ void CChoreoScene::SetTime( float t ) void CChoreoScene::LoopToTime( float t ) { m_flCurrentTime = t; + + m_flStartLoopTime = t; } //----------------------------------------------------------------------------- diff --git a/mp/src/game/shared/choreoscene.h b/mp/src/game/shared/choreoscene.h index e4d22871..d8203c14 100644 --- a/mp/src/game/shared/choreoscene.h +++ b/mp/src/game/shared/choreoscene.h @@ -326,6 +326,8 @@ private: // Current simulation time float m_flCurrentTime; + float m_flStartLoopTime; + float m_flStartTime; float m_flEndTime; diff --git a/mp/src/game/shared/effect_color_tables.h b/mp/src/game/shared/effect_color_tables.h index 322d0e08..348e894f 100644 --- a/mp/src/game/shared/effect_color_tables.h +++ b/mp/src/game/shared/effect_color_tables.h @@ -33,10 +33,10 @@ enum // Commander mode table static colorentry_t commandercolors[] = { - { COMMAND_POINT_RED, 1.0, 0.0, 0.0 }, - { COMMAND_POINT_BLUE, 0.0, 0.0, 1.0 }, - { COMMAND_POINT_GREEN, 0.0, 1.0, 0.0 }, - { COMMAND_POINT_YELLOW, 1.0, 1.0, 0.0 }, + { COMMAND_POINT_RED, 1, 0, 0 }, + { COMMAND_POINT_BLUE, 0, 0, 1 }, + { COMMAND_POINT_GREEN, 0, 1, 0 }, + { COMMAND_POINT_YELLOW, 1, 1, 0 }, }; static colorentry_t bloodcolors[] = diff --git a/mp/src/game/shared/eventlist.cpp b/mp/src/game/shared/eventlist.cpp index e5b01fed..84014b49 100644 --- a/mp/src/game/shared/eventlist.cpp +++ b/mp/src/game/shared/eventlist.cpp @@ -248,4 +248,5 @@ void EventList_RegisterSharedEvents( void ) REGISTER_SHARED_ANIMEVENT( AE_WPN_UNHIDE, AE_TYPE_CLIENT | AE_TYPE_SERVER ); REGISTER_SHARED_ANIMEVENT( AE_WPN_PLAYWPNSOUND, AE_TYPE_CLIENT | AE_TYPE_SERVER ); + REGISTER_SHARED_ANIMEVENT( AE_RD_ROBOT_POP_PANELS_OFF, AE_TYPE_CLIENT | AE_TYPE_SERVER ); }
\ No newline at end of file diff --git a/mp/src/game/shared/eventlist.h b/mp/src/game/shared/eventlist.h index 1ce83a4c..c4944616 100644 --- a/mp/src/game/shared/eventlist.h +++ b/mp/src/game/shared/eventlist.h @@ -85,6 +85,8 @@ typedef enum AE_WPN_PLAYWPNSOUND, // Play a weapon sound from the weapon script file + AE_RD_ROBOT_POP_PANELS_OFF, + LAST_SHARED_ANIMEVENT, } Animevent; diff --git a/mp/src/game/shared/gamemovement.cpp b/mp/src/game/shared/gamemovement.cpp index 8de6fc32..8b5921bd 100644 --- a/mp/src/game/shared/gamemovement.cpp +++ b/mp/src/game/shared/gamemovement.cpp @@ -518,7 +518,7 @@ void CGameMovement::DiffPrint( char const *fmt, ... ) #endif // !PREDICTION_ERROR_CHECK_LEVEL #ifndef _XBOX -void COM_Log( char *pszFile, const char *fmt, ...) +void COM_Log( const char *pszFile, const char *fmt, ...) { va_list argptr; char string[1024]; diff --git a/mp/src/game/shared/gamerules.h b/mp/src/game/shared/gamerules.h index 4b2f5124..347f7941 100644 --- a/mp/src/game/shared/gamerules.h +++ b/mp/src/game/shared/gamerules.h @@ -205,6 +205,8 @@ public: #else + virtual void Status( void (*print) (const char *fmt, ...) ) {} + virtual void GetTaggedConVarList( KeyValues *pCvarTagList ) {} // NVNT see if the client of the player entered is using a haptic device. diff --git a/mp/src/game/shared/mapentities_shared.cpp b/mp/src/game/shared/mapentities_shared.cpp index 420c3e1d..2cd6fe01 100644 --- a/mp/src/game/shared/mapentities_shared.cpp +++ b/mp/src/game/shared/mapentities_shared.cpp @@ -125,7 +125,7 @@ const char *MapEntity_ParseToken( const char *data, char *newToken ) for ( const char *c = s_BraceChars; *c; c++ ) { - s_BraceCharacters[*c] = true; + s_BraceCharacters[(unsigned)*c] = true; } } diff --git a/mp/src/game/shared/mp_shareddefs.cpp b/mp/src/game/shared/mp_shareddefs.cpp index b555a88f..66a5e0e3 100644 --- a/mp/src/game/shared/mp_shareddefs.cpp +++ b/mp/src/game/shared/mp_shareddefs.cpp @@ -185,6 +185,10 @@ const char *g_pszMPConcepts[] = "TLK_MVM_LOOT_RARE", // MP_CONCEPT_MVM_LOOT_RARE "TLK_MVM_LOOT_ULTRARARE", // MP_CONCEPT_MVM_LOOT_ULTRARARE "TLK_MEDIC_HEAL_SHIELD", // MP_CONCEPT_MEDIC_HEAL_SHIELD + + "TLK_TAUNT_EUREKA_EFFECT", // MP_CONCEPT_TAUNT_EUREKA_EFFECT_TELEPORT + + "TLK_COMBO_KILLED", // MP_CONCEPT_COMBO_KILLED }; COMPILE_TIME_ASSERT( ARRAYSIZE( g_pszMPConcepts ) == MP_TF_CONCEPT_COUNT ); diff --git a/mp/src/game/shared/mp_shareddefs.h b/mp/src/game/shared/mp_shareddefs.h index 8ad6011b..d0fa99c8 100644 --- a/mp/src/game/shared/mp_shareddefs.h +++ b/mp/src/game/shared/mp_shareddefs.h @@ -195,6 +195,10 @@ enum MP_CONCEPT_MVM_LOOT_ULTRARARE, // "TLK_MVM_LOOT_ULTRARARE" MP_CONCEPT_MEDIC_HEAL_SHIELD, // "TLK_MEDIC_HEAL_SHIELD" + MP_CONCEPT_TAUNT_EUREKA_EFFECT_TELEPORT,// "TLK_TAUNT_EUREKA_EFFECT" + + MP_CONCEPT_COMBO_KILLED, // "TLK_COMBO_KILLED" + MP_TF_CONCEPT_COUNT // Other MP_CONCEPT_* start he using MP_TF_CONCEPT_COUNT + 1 as start. diff --git a/mp/src/game/shared/multiplay_gamerules.cpp b/mp/src/game/shared/multiplay_gamerules.cpp index abecba9e..16cfe297 100644 --- a/mp/src/game/shared/multiplay_gamerules.cpp +++ b/mp/src/game/shared/multiplay_gamerules.cpp @@ -1149,14 +1149,17 @@ ConVarRef suitcharger( "sk_suitcharger" ); } } - void StripChar(char *szBuffer, const char cWhiteSpace ) + // Strip ' ' and '\n' characters from string. + static void StripWhitespaceChars( char *szBuffer ) { + char *szOut = szBuffer; - while ( char *pSpace = strchr( szBuffer, cWhiteSpace ) ) + for ( char *szIn = szOut; *szIn; szIn++ ) { - char *pNextChar = pSpace + sizeof(char); - V_strcpy( pSpace, pNextChar ); + if ( *szIn != ' ' && *szIn != '\r' ) + *szOut++ = *szIn; } + *szOut = '\0'; } void CMultiplayRules::GetNextLevelName( char *pszNextMap, int bufsize, bool bRandom /* = false */ ) @@ -1283,9 +1286,8 @@ ConVarRef suitcharger( "sk_suitcharger" ); { bool bIgnore = false; - // Strip out the spaces in the name - StripChar( mapList[i] , '\r'); - StripChar( mapList[i] , ' '); + // Strip out ' ' and '\r' chars. + StripWhitespaceChars( mapList[i] ); if ( !Q_strncmp( mapList[i], "//", 2 ) || mapList[i][0] == '\0' ) { diff --git a/mp/src/game/shared/particle_property.cpp b/mp/src/game/shared/particle_property.cpp index c1c44a1a..5b5c2603 100644 --- a/mp/src/game/shared/particle_property.cpp +++ b/mp/src/game/shared/particle_property.cpp @@ -365,7 +365,7 @@ void CParticleProperty::StopParticlesInvolving( CBaseEntity *pEntity ) // Purpose: Stop all effects that were created using the given definition // name. //----------------------------------------------------------------------------- -void CParticleProperty::StopParticlesNamed( const char *pszEffectName, bool bForceRemoveInstantly /* =false */ ) +void CParticleProperty::StopParticlesNamed( const char *pszEffectName, bool bForceRemoveInstantly /* =false */, bool bInverse /*= false*/ ) { CParticleSystemDefinition *pDef = g_pParticleSystemMgr->FindParticleSystem( pszEffectName ); AssertMsg1(pDef, "Could not find particle definition %s", pszEffectName ); @@ -384,13 +384,15 @@ void CParticleProperty::StopParticlesNamed( const char *pszEffectName, bool bFor { // for each effect... CNewParticleEffect *pParticleEffect = m_ParticleEffects[i].pParticleEffect.GetObject(); - if (pParticleEffect->m_pDef() == pDef) + bool bMatches = pParticleEffect->m_pDef() == pDef; + if ( bMatches == !bInverse ) { pParticleEffect->StopEmission( false, bRemoveInstantly ); } } } + void CParticleProperty::StopParticlesWithNameAndAttachment( const char *pszEffectName, int iAttachmentPoint, bool bForceRemoveInstantly /* =false */ ) { CParticleSystemDefinition *pDef = g_pParticleSystemMgr->FindParticleSystem( pszEffectName ); @@ -562,7 +564,7 @@ void CParticleProperty::UpdateControlPoint( ParticleEffectList_t *pEffect, int i #ifdef TF_CLIENT_DLL CBaseEntity *pWearable = (CBaseEntity*) pPoint->hEntity.Get(); - if ( pWearable && dynamic_cast<IHasAttributes*>( pWearable ) && !pWearable->IsPlayer() ) + if ( pWearable && GetAttribInterface( pWearable ) && !pWearable->IsPlayer() ) { C_BaseAnimating *pAnimating = pPoint->hEntity->GetBaseAnimating(); if ( pAnimating ) diff --git a/mp/src/game/shared/particle_property.h b/mp/src/game/shared/particle_property.h index 30d62e9e..7978d8e7 100644 --- a/mp/src/game/shared/particle_property.h +++ b/mp/src/game/shared/particle_property.h @@ -90,7 +90,7 @@ public: // kill all particle systems involving a given entity for their control points void StopParticlesInvolving( CBaseEntity *pEntity ); - void StopParticlesNamed( const char *pszEffectName, bool bForceRemoveInstantly = false ); ///< kills all particles using the given definition name + void StopParticlesNamed( const char *pszEffectName, bool bForceRemoveInstantly = false, bool bInverse = false ); ///< kills all particles using the given definition name void StopParticlesWithNameAndAttachment( const char *pszEffectName, int iAttachmentPoint, bool bForceRemoveInstantly = false ); ///< kills all particles using the given definition name // Particle System hooks diff --git a/mp/src/game/shared/particlesystemquery.cpp b/mp/src/game/shared/particlesystemquery.cpp index b97a334b..abd33c77 100644 --- a/mp/src/game/shared/particlesystemquery.cpp +++ b/mp/src/game/shared/particlesystemquery.cpp @@ -231,7 +231,7 @@ void CParticleSystemQuery::GetRandomPointsOnControllingObjectHitBox( { bSucesss = true; - Vector vecWorldPosition; + Vector vecWorldPosition(0, 0, 0); float u = 0, v = 0, w = 0; int nHitbox = 0; int nNumIters = nNumTrysToGetAPointInsideTheModel; @@ -308,7 +308,7 @@ void CParticleSystemQuery::GetRandomPointsOnControllingObjectHitBox( - Vector vecWorldPosition; + Vector vecWorldPosition(0, 0, 0); float u = 0, v = 0, w = 0; int nHitbox = 0; int nNumIters = nNumTrysToGetAPointInsideTheModel; diff --git a/mp/src/game/shared/predictioncopy.cpp b/mp/src/game/shared/predictioncopy.cpp index 72c3ae52..9721326e 100644 --- a/mp/src/game/shared/predictioncopy.cpp +++ b/mp/src/game/shared/predictioncopy.cpp @@ -514,7 +514,7 @@ void CPredictionCopy::DescribeQuaternion( difftype_t dt, Quaternion* outValue, c for ( int j = 0; j < 4; j++ ) { - delta[i] = outValue[i][j] - inValue[i][j]; + delta[j] = outValue[i][j] - inValue[i][j]; } ReportFieldsDiffer( "quaternion[] differs (1st diff) (net %f %f %f %f - pred %f %f %f %f) delta(%f %f %f %f)\n", @@ -933,7 +933,7 @@ CPredictionCopy::difftype_t CPredictionCopy::CompareQuaternion( Quaternion* outV for ( int j = 0; j < 4; j++ ) { - delta[i] = outValue[i][j] - inValue[i][j]; + delta[j] = outValue[i][j] - inValue[i][j]; } if ( tolerance > 0.0f ) diff --git a/mp/src/game/shared/props_shared.cpp b/mp/src/game/shared/props_shared.cpp index 6d0f9209..7bb0c03b 100644 --- a/mp/src/game/shared/props_shared.cpp +++ b/mp/src/game/shared/props_shared.cpp @@ -600,6 +600,10 @@ public: pModel->mpBreakMode = MULTIPLAYER_BREAK_CLIENTSIDE; } } + else if ( !strcmpi( pKey, "velocity" ) ) + { + UTIL_StringToVector( pModel->velocity.Base(), pValue ); + } } virtual void SetDefaults( void *pData ) { @@ -617,6 +621,7 @@ public: pModel->placementName[0] = 0; pModel->placementIsBone = false; pModel->mpBreakMode = MULTIPLAYER_BREAK_DEFAULT; + pModel->velocity = vec3_origin; m_wroteCollisionGroup = false; } @@ -626,7 +631,7 @@ private: bool m_wroteCollisionGroup; }; -void BreakModelList( CUtlVector<breakmodel_t> &list, int modelindex, float defBurstScale, int defCollisionGroup ) +void BuildPropList( const char *pszBlockName, CUtlVector<breakmodel_t> &list, int modelindex, float defBurstScale, int defCollisionGroup ) { vcollide_t *pCollide = modelinfo->GetVCollide( modelindex ); if ( !pCollide ) @@ -638,7 +643,7 @@ void BreakModelList( CUtlVector<breakmodel_t> &list, int modelindex, float defBu CBreakParser breakParser( defBurstScale, defCollisionGroup ); const char *pBlock = pParse->GetCurrentBlockName(); - if ( !strcmpi( pBlock, "break" ) ) + if ( !strcmpi( pBlock, pszBlockName ) ) { int index = list.AddToTail(); breakmodel_t &breakModel = list[index]; @@ -652,6 +657,11 @@ void BreakModelList( CUtlVector<breakmodel_t> &list, int modelindex, float defBu physcollision->VPhysicsKeyParserDestroy( pParse ); } +void BreakModelList( CUtlVector<breakmodel_t> &list, int modelindex, float defBurstScale, int defCollisionGroup ) +{ + BuildPropList( "break", list, modelindex, defBurstScale, defCollisionGroup ); +} + #if !defined(_STATIC_LINKED) || defined(CLIENT_DLL) int GetAutoMultiplayerPhysicsMode( Vector size, float mass ) { @@ -1226,9 +1236,8 @@ void PropBreakableCreateAll( int modelindex, IPhysicsObject *pPhysics, const Vec // Purpose: // Input : modelindex - //----------------------------------------------------------------------------- -void PrecacheGibsForModel( int iModel ) +void PrecachePropsForModel( int iModel, const char *pszBlockName ) { - VPROF_BUDGET( "PrecacheGibsForModel", VPROF_BUDGETGROUP_PLAYER ); vcollide_t *pCollide = modelinfo->GetVCollide( iModel ); if ( !pCollide ) return; @@ -1241,7 +1250,7 @@ void PrecacheGibsForModel( int iModel ) while ( !pParse->Finished() ) { const char *pBlock = pParse->GetCurrentBlockName(); - if ( !strcmpi( pBlock, "break" ) ) + if ( !strcmpi( pBlock, pszBlockName ) ) { breakmodel_t breakModel; pParse->ParseCustom( &breakModel, &breakParser ); @@ -1257,6 +1266,12 @@ void PrecacheGibsForModel( int iModel ) physcollision->VPhysicsKeyParserDestroy( pParse ); } +void PrecacheGibsForModel( int iModel ) +{ + VPROF_BUDGET( "PrecacheGibsForModel", VPROF_BUDGETGROUP_PLAYER ); + PrecachePropsForModel( iModel, "break" ); +} + //----------------------------------------------------------------------------- // Purpose: // Input : &list - @@ -1448,12 +1463,21 @@ CBaseEntity *CreateGibsFromList( CUtlVector<breakmodel_t> &list, int modelindex, } Vector objectVelocity = params.velocity; - float flScale = VectorNormalize( objectVelocity ); - objectVelocity.x += RandomFloat( -1.f, 1.0f ); - objectVelocity.y += RandomFloat( -1.0f, 1.0f ); - objectVelocity.z += RandomFloat( 0.0f, 1.0f ); - VectorNormalize( objectVelocity ); - objectVelocity *= flScale; + Vector gibVelocity = vec3_origin; + if ( !list[i].velocity.IsZero() ) + { + VectorRotate( list[i].velocity, matrix, gibVelocity ); + objectVelocity = gibVelocity; + } + else + { + float flScale = VectorNormalize( objectVelocity ); + objectVelocity.x += RandomFloat( -1.f, 1.0f ); + objectVelocity.y += RandomFloat( -1.0f, 1.0f ); + objectVelocity.z += RandomFloat( 0.0f, 1.0f ); + VectorNormalize( objectVelocity ); + objectVelocity *= flScale; + } if (pPhysics) { diff --git a/mp/src/game/shared/props_shared.h b/mp/src/game/shared/props_shared.h index c63cb212..07878d82 100644 --- a/mp/src/game/shared/props_shared.h +++ b/mp/src/game/shared/props_shared.h @@ -217,6 +217,7 @@ struct breakmodel_t bool placementIsBone; bool isMotionDisabled; mp_break_t mpBreakMode; + Vector velocity; }; struct breakablepropparams_t @@ -242,11 +243,13 @@ struct breakablepropparams_t const char *GetMassEquivalent(float flMass); int GetAutoMultiplayerPhysicsMode( Vector size, float mass ); +void BuildPropList( const char *pszBlockName, CUtlVector<breakmodel_t> &list, int modelindex, float defBurstScale, int defCollisionGroup ); void BreakModelList( CUtlVector<breakmodel_t> &list, int modelindex, float defBurstScale, int defCollisionGroup ); void PropBreakableCreateAll( int modelindex, IPhysicsObject *pPhysics, const breakablepropparams_t ¶ms, CBaseEntity *pEntity, int iPrecomputedBreakableCount, bool bIgnoreGibLImit, bool defaultLocation = true ); void PropBreakableCreateAll( int modelindex, IPhysicsObject *pPhysics, const Vector &origin, const QAngle &angles, const Vector &velocity, const AngularImpulse &angularVelocity, float impactEnergyScale, float burstScale, int collisionGroup, CBaseEntity *pEntity = NULL, bool defaultLocation = true ); // Player gibs. +void PrecachePropsForModel( int iModel, const char *pszBlockName ); void PrecacheGibsForModel( int iModel ); void BuildGibList( CUtlVector<breakmodel_t> &list, int modelindex, float defBurstScale, int defCollisionGroup ); CBaseEntity *CreateGibsFromList( CUtlVector<breakmodel_t> &list, int modelindex, IPhysicsObject *pPhysics, const breakablepropparams_t ¶ms, CBaseEntity *pEntity, int iPrecomputedBreakableCount, bool bIgnoreGibLImit, bool defaultLocation = true, CUtlVector<EHANDLE> *pGibList = NULL, bool bBurning = false ); diff --git a/mp/src/game/shared/sceneimage.cpp b/mp/src/game/shared/sceneimage.cpp index 55426008..053d0506 100644 --- a/mp/src/game/shared/sceneimage.cpp +++ b/mp/src/game/shared/sceneimage.cpp @@ -368,7 +368,7 @@ bool CSceneImage::CreateSceneImageFile( CUtlBuffer &targetBuffer, char const *pc if ( !bQuiet ) { - Msg( "Scenes: String Table: %d bytes\n", stringOffsets.Count() * sizeof( int ) ); + Msg( "Scenes: String Table: %llu bytes\n", (uint64)(stringOffsets.Count() * sizeof( int )) ); Msg( "Scenes: String Pool: %d bytes\n", stringPool.TellMaxPut() ); } diff --git a/mp/src/game/shared/shareddefs.h b/mp/src/game/shared/shareddefs.h index 842d2f06..11156a36 100644 --- a/mp/src/game/shared/shareddefs.h +++ b/mp/src/game/shared/shareddefs.h @@ -140,7 +140,7 @@ typedef enum VOTE_FAILED_ISSUE_DISABLED, VOTE_FAILED_MAP_NOT_FOUND, VOTE_FAILED_MAP_NAME_REQUIRED, - VOTE_FAILED_FAILED_RECENTLY, + VOTE_FAILED_ON_COOLDOWN, VOTE_FAILED_TEAM_CANT_CALL, VOTE_FAILED_WAITINGFORPLAYERS, VOTE_FAILED_PLAYERNOTFOUND, diff --git a/mp/src/game/shared/takedamageinfo.h b/mp/src/game/shared/takedamageinfo.h index 702e9322..a18493e0 100644 --- a/mp/src/game/shared/takedamageinfo.h +++ b/mp/src/game/shared/takedamageinfo.h @@ -55,7 +55,8 @@ public: void AddDamage( float flAddAmount ); void SubtractDamage( float flSubtractAmount ); float GetDamageBonus() const; - void SetDamageBonus( float flBonus ); + CBaseEntity *GetDamageBonusProvider() const; + void SetDamageBonus( float flBonus, CBaseEntity *pProvider = NULL ); float GetBaseDamage() const; bool BaseDamageIsValid() const; @@ -125,6 +126,7 @@ protected: int m_iDamagedOtherPlayers; int m_iPlayerPenetrationCount; float m_flDamageBonus; // Anything that increases damage (crit) - store the delta + EHANDLE m_hDamageBonusProvider; // Who gave us the ability to do extra damage? bool m_bForceFriendlyFire; // Ideally this would be a dmg type, but we can't add more DECLARE_SIMPLE_DATADESC(); @@ -247,9 +249,15 @@ inline float CTakeDamageInfo::GetDamageBonus() const return m_flDamageBonus; } -inline void CTakeDamageInfo::SetDamageBonus( float flBonus ) +inline CBaseEntity *CTakeDamageInfo::GetDamageBonusProvider() const +{ + return m_hDamageBonusProvider; +} + +inline void CTakeDamageInfo::SetDamageBonus( float flBonus, CBaseEntity *pProvider /*= NULL*/ ) { m_flDamageBonus = flBonus; + m_hDamageBonusProvider = pProvider; } inline float CTakeDamageInfo::GetBaseDamage() const diff --git a/mp/src/game/shared/teamplay_round_timer.cpp b/mp/src/game/shared/teamplay_round_timer.cpp index f993749a..6c6ccb77 100644 --- a/mp/src/game/shared/teamplay_round_timer.cpp +++ b/mp/src/game/shared/teamplay_round_timer.cpp @@ -245,6 +245,7 @@ CTeamRoundTimer::CTeamRoundTimer( void ) m_bResetTimeOnRoundStart = false; m_nTimeToUseAfterSetupFinished = 0; m_flNextOvertimeNag = 0; + m_flLastTime = 0.f; #endif } @@ -781,6 +782,9 @@ void CTeamRoundTimer::SetTimerThink( int nType ) //----------------------------------------------------------------------------- void CTeamRoundTimer::RoundTimerSetupThink( void ) { + float flLastTime = m_flLastTime; + m_flLastTime = GetTimeRemaining(); + if ( TeamplayRoundBasedRules()->IsInPreMatch() == true && IsDisabled() == false ) { inputdata_t data; @@ -797,6 +801,22 @@ void CTeamRoundTimer::RoundTimerSetupThink( void ) float flTime = GetTimeRemaining(); TeamplayRoundBasedRules()->SetOvertime( false ); + if ( m_flLastTime > 0.f ) + { + int nLastSecond = floor( flLastTime ); + int nThisSecond = floor( flTime ); + + if ( nLastSecond != nThisSecond ) + { + IGameEvent *event = gameeventmanager->CreateEvent( "teamplay_pre_round_time_left" ); + if ( event ) + { + event->SetInt( "time", nThisSecond ); + gameeventmanager->FireEvent( event ); + } + } + } + if ( flTime <= 0.0f && m_bFireFinished ) { IGameEvent *event = gameeventmanager->CreateEvent( "teamplay_setup_finished" ); @@ -1291,14 +1311,14 @@ void CTeamRoundTimer::InputAddTeamTime( inputdata_t &input ) // get the team p = nexttoken( token, p, ' ' ); - if ( token ) + if ( token[0] ) { nTeam = Q_atoi( token ); } // get the time p = nexttoken( token, p, ' ' ); - if ( token ) + if ( token[0] ) { nSeconds = Q_atoi( token ); } diff --git a/mp/src/game/shared/teamplay_round_timer.h b/mp/src/game/shared/teamplay_round_timer.h index 103b2546..fd2e7613 100644 --- a/mp/src/game/shared/teamplay_round_timer.h +++ b/mp/src/game/shared/teamplay_round_timer.h @@ -158,6 +158,7 @@ private: COutputEvent m_OnSetupFinished; float m_flNextOvertimeNag; + float m_flLastTime; DECLARE_DATADESC(); diff --git a/mp/src/game/shared/teamplayroundbased_gamerules.cpp b/mp/src/game/shared/teamplayroundbased_gamerules.cpp index 26a75b18..3930798d 100644 --- a/mp/src/game/shared/teamplayroundbased_gamerules.cpp +++ b/mp/src/game/shared/teamplayroundbased_gamerules.cpp @@ -90,6 +90,7 @@ BEGIN_NETWORK_TABLE_NOBASE( CTeamplayRoundBasedRules, DT_TeamplayRoundBasedRules RecvPropBool( RECVINFO( m_bStopWatch ) ), RecvPropBool( RECVINFO( m_bMultipleTrains ) ), RecvPropArray3( RECVINFO_ARRAY(m_bPlayerReady), RecvPropBool( RECVINFO(m_bPlayerReady[0]) ) ), + RecvPropBool( RECVINFO( m_bCheatsEnabledDuringLevel ) ), #else SendPropInt( SENDINFO( m_iRoundState ), 5 ), @@ -107,6 +108,7 @@ BEGIN_NETWORK_TABLE_NOBASE( CTeamplayRoundBasedRules, DT_TeamplayRoundBasedRules SendPropBool( SENDINFO( m_bStopWatch ) ), SendPropBool( SENDINFO( m_bMultipleTrains ) ), SendPropArray3( SENDINFO_ARRAY3(m_bPlayerReady), SendPropBool( SENDINFO_ARRAY(m_bPlayerReady) ) ), + SendPropBool( SENDINFO( m_bCheatsEnabledDuringLevel ) ), #endif END_NETWORK_TABLE() @@ -184,7 +186,7 @@ ConVar tf_arena_round_time( "tf_arena_round_time", "0", FCVAR_NOTIFY | FCVAR_REP ConVar tf_arena_max_streak( "tf_arena_max_streak", "3", FCVAR_NOTIFY | FCVAR_REPLICATED, "Teams will be scrambled if one team reaches this streak" ); ConVar tf_arena_use_queue( "tf_arena_use_queue", "1", FCVAR_REPLICATED | FCVAR_NOTIFY, "Enables the spectator queue system for Arena." ); -ConVar mp_teams_unbalance_limit( "mp_teams_unbalance_limit", "1", FCVAR_REPLICATED | FCVAR_NOTIFY, +ConVar mp_teams_unbalance_limit( "mp_teams_unbalance_limit", "1", FCVAR_REPLICATED, "Teams are unbalanced when one team has this many more players than the other team. (0 disables check)", true, 0, // min value true, 30 // max value @@ -421,6 +423,7 @@ CTeamplayRoundBasedRules::CTeamplayRoundBasedRules( void ) m_nAutoBalanceQueuePlayerScore = -1; SetDefLessFunc( m_GameTeams ); + m_bCheatsEnabledDuringLevel = false; #endif } @@ -554,6 +557,18 @@ float CTeamplayRoundBasedRules::GetMinTimeWhenPlayerMaySpawn( CBasePlayer *pPlay //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- +void CTeamplayRoundBasedRules::LevelInitPostEntity( void ) +{ + BaseClass::LevelInitPostEntity(); + +#ifdef GAME_DLL + m_bCheatsEnabledDuringLevel = sv_cheats && sv_cheats->GetBool(); +#endif // GAME_DLL +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- float CTeamplayRoundBasedRules::GetRespawnTimeScalar( int iTeam ) { // For long respawn times, scale the time as the number of players drops @@ -631,6 +646,12 @@ void CTeamplayRoundBasedRules::Think( void ) m_flNextPeriodicThink = gpGlobals->curtime + 1.0; } + // Watch dog for cheats ever being enabled during a level + if ( !m_bCheatsEnabledDuringLevel && sv_cheats && sv_cheats->GetBool() ) + { + m_bCheatsEnabledDuringLevel = true; + } + // Bypass teamplay think. CGameRules::Think(); } @@ -954,7 +975,11 @@ void CTeamplayRoundBasedRules::CheckRestartRound( void ) int iDelayMax = 60; #if defined(TF_CLIENT_DLL) || defined(TF_DLL) +#ifdef STAGING_ONLY + if ( TFGameRules() && ( TFGameRules()->IsMannVsMachineMode() || TFGameRules()->IsRatedTournamentMode() ) ) +#else if ( TFGameRules() && TFGameRules()->IsMannVsMachineMode() ) +#endif // STAGING_ONLY { iDelayMax = 180; } @@ -1415,6 +1440,12 @@ void CTeamplayRoundBasedRules::State_Enter_PREROUND( void ) State_Transition( GR_STATE_BETWEEN_RNDS ); TFObjectiveResource()->SetMannVsMachineBetweenWaves( true ); } +#ifdef STAGING_ONLY + else if ( TFGameRules() && TFGameRules()->IsRatedTournamentMode() ) + { + State_Transition( GR_STATE_BETWEEN_RNDS ); + } +#endif // STAGING_ONLY #endif // #if defined(TF_CLIENT_DLL) || defined(TF_DLL) else { @@ -1501,14 +1532,23 @@ void CTeamplayRoundBasedRules::CheckReadyRestart( void ) m_flRestartRoundTime = -1; #ifdef TF_DLL - if ( TFGameRules() && TFGameRules()->IsMannVsMachineMode() && g_pPopulationManager ) + if ( TFGameRules() ) { - if ( TFObjectiveResource()->GetMannVsMachineIsBetweenWaves() ) + if ( TFGameRules()->IsMannVsMachineMode() && g_pPopulationManager ) + { + if ( TFObjectiveResource()->GetMannVsMachineIsBetweenWaves() ) + { + g_pPopulationManager->StartCurrentWave(); + return; + } + } +#ifdef STAGING_ONLY + else if ( TFGameRules()->IsRatedTournamentMode() ) { - g_pPopulationManager->StartCurrentWave(); + TFGameRules()->StartRatedTournamentMatch(); + return; } - - return; +#endif // STAGING_ONLY } #endif // TF_DLL @@ -1703,6 +1743,19 @@ void CTeamplayRoundBasedRules::State_Enter_TEAM_WIN( void ) InternalHandleTeamWin( m_iWinningTeam ); SendWinPanelInfo(); + +#ifdef STAGING_ONLY +#ifdef TF_DLL + if ( TFGameRules() && TFGameRules()->IsRatedTournamentMode() ) + { + // Do this now, so players don't leave before the usual CheckWinLimit() call happens + if ( CheckWinLimit() ) + { + TFGameRules()->SkillRating_CalculateAdjustmentForTeams( m_iWinningTeam ); + } + } +#endif // TF_DLL +#endif // STAGING_ONLY } //----------------------------------------------------------------------------- @@ -1710,8 +1763,16 @@ void CTeamplayRoundBasedRules::State_Enter_TEAM_WIN( void ) //----------------------------------------------------------------------------- void CTeamplayRoundBasedRules::State_Think_TEAM_WIN( void ) { - if( gpGlobals->curtime > m_flStateTransitionTime ) + if ( gpGlobals->curtime > m_flStateTransitionTime ) { +#ifdef TF_DLL + IGameEvent *event = gameeventmanager->CreateEvent( "scorestats_accumulated_update" ); + if ( event ) + { + gameeventmanager->FireEvent( event ); + } +#endif // TF_DLL + bool bDone = !(!CheckTimeLimit() && !CheckWinLimit() && !CheckMaxRounds() && !CheckNextLevelCvar()); // check the win limit, max rounds, time limit and nextlevel cvar before starting the next round @@ -2632,6 +2693,10 @@ void CTeamplayRoundBasedRules::RoundRespawn( void ) } #endif + // Free any edicts that were marked deleted. This should hopefully clear some out + // so the below function can use the now freed ones. + engine->AllowImmediateEdictReuse(); + RespawnPlayers( true ); // reset per-round scores for each player @@ -3020,6 +3085,14 @@ void CTeamplayRoundBasedRules::ResetScores( void ) m_bResetPlayerScores = true; m_bResetRoundsPlayed = true; //m_flStopWatchTime = -1.0f; + +#ifdef TF_DLL + IGameEvent *event = gameeventmanager->CreateEvent( "scorestats_accumulated_reset" ); + if ( event ) + { + gameeventmanager->FireEvent( event ); + } +#endif // TF_DLL } //----------------------------------------------------------------------------- diff --git a/mp/src/game/shared/teamplayroundbased_gamerules.h b/mp/src/game/shared/teamplayroundbased_gamerules.h index cf584092..ddf6e791 100644 --- a/mp/src/game/shared/teamplayroundbased_gamerules.h +++ b/mp/src/game/shared/teamplayroundbased_gamerules.h @@ -88,6 +88,11 @@ enum { WINREASON_TIMELIMIT, WINREASON_WINLIMIT, WINREASON_WINDIFFLIMIT, +#if defined(TF_CLIENT_DLL) || defined(TF_DLL) + WINREASON_RD_REACTOR_CAPTURED, + WINREASON_RD_CORES_COLLECTED, + WINREASON_RD_REACTOR_RETURNED, +#endif }; enum stalemate_reasons_t @@ -183,6 +188,7 @@ public: virtual float GetNextRespawnWave( int iTeam, CBasePlayer *pPlayer ); virtual bool HasPassedMinRespawnTime( CBasePlayer *pPlayer ); + virtual void LevelInitPostEntity( void ); virtual float GetRespawnTimeScalar( int iTeam ); virtual float GetRespawnWaveMaxLength( int iTeam, bool bScaleWithNumPlayers = true ); virtual bool ShouldRespawnQuickly( CBasePlayer *pPlayer ) { return false; } @@ -541,6 +547,7 @@ private: public: bool WouldChangeUnbalanceTeams( int iNewTeam, int iCurrentTeam ); bool AreTeamsUnbalanced( int &iHeaviestTeam, int &iLightestTeam ); + virtual bool HaveCheatsBeenEnabledDuringLevel( void ) { return m_bCheatsEnabledDuringLevel; } protected: CNetworkVar( gamerules_roundstate_t, m_iRoundState ); @@ -557,10 +564,11 @@ protected: CNetworkVar( float, m_flMapResetTime ); // Time that the map was reset CNetworkArray( float, m_flNextRespawnWave, MAX_TEAMS ); // Minor waste, but cleaner code CNetworkArray( bool, m_bTeamReady, MAX_TEAMS ); - CNetworkVar( bool, m_bStopWatch ); - CNetworkVar( bool, m_bMultipleTrains ); // two trains in this map? + CNetworkVar( bool, m_bStopWatch ); + CNetworkVar( bool, m_bMultipleTrains ); // two trains in this map? CNetworkArray( bool, m_bPlayerReady, MAX_PLAYERS ); - + CNetworkVar( bool, m_bCheatsEnabledDuringLevel ); + public: CNetworkArray( float, m_TeamRespawnWaveTimes, MAX_TEAMS ); // Time between each team's respawn wave diff --git a/mp/src/game/shared/voice_gamemgr.cpp b/mp/src/game/shared/voice_gamemgr.cpp index 2feb048d..15523859 100644 --- a/mp/src/game/shared/voice_gamemgr.cpp +++ b/mp/src/game/shared/voice_gamemgr.cpp @@ -48,6 +48,7 @@ CVoiceGameMgr g_VoiceGameMgr; // ------------------------------------------------------------------------ // // Find a player with a case-insensitive name search. +#if 0 static CBasePlayer* FindPlayerByName(const char *pTestName) { for(int i=1; i <= gpGlobals->maxClients; i++) @@ -69,6 +70,7 @@ static CBasePlayer* FindPlayerByName(const char *pTestName) return NULL; } +#endif static void VoiceServerDebug( const char *pFmt, ... ) { |