diff options
| author | Joe Ludwig <[email protected]> | 2013-12-03 08:54:16 -0800 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-12-03 08:54:16 -0800 |
| commit | beaae8ac45a2f322a792404092d4482065bef7ef (patch) | |
| tree | 747f35193ba235f0f0b070c05b53468a54559c8e /sp/src/game/shared | |
| parent | Make .xcconfigs text files too. (diff) | |
| download | source-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.tar.xz source-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.zip | |
Updated the SDK with the latest code from the TF and HL2 branches
* Adds support for Visual Studio 2012 and 2013
* VR Mode:
. Switches from headtrack.dll to sourcevr.dll
. Improved readability of the UI in VR
. Removed the IPD calibration tool. TF2 will now obey the Oculus
configuration file. Use the Oculus calibration tool in your SDK or
install and run "OpenVR" under Tools in Steam to calibrate your IPD.
. Added dropdown to enable VR mode in the Video options. Removed the -vr
command line option.
. Added the ability to switch in and out of VR mode without quitting the
game
. By default VR mode will run full screen. To switch back to a
borderless window set the vr_force_windowed convar.
. Added support for VR mode on Linux
* Many assorted bug fixes and other changes from Team Fortress in
various shared files
Diffstat (limited to 'sp/src/game/shared')
28 files changed, 322 insertions, 43 deletions
diff --git a/sp/src/game/shared/activitylist.cpp b/sp/src/game/shared/activitylist.cpp index 94bcff15..2b421252 100644 --- a/sp/src/game/shared/activitylist.cpp +++ b/sp/src/game/shared/activitylist.cpp @@ -2270,6 +2270,11 @@ void ActivityList_RegisterSharedActivities( void ) REGISTER_SHARED_ACTIVITY( ACT_THROWABLE_VM_IDLE ); REGISTER_SHARED_ACTIVITY( ACT_THROWABLE_VM_FIRE ); + REGISTER_SHARED_ACTIVITY( ACT_SPELL_VM_DRAW ); + REGISTER_SHARED_ACTIVITY( ACT_SPELL_VM_IDLE ); + REGISTER_SHARED_ACTIVITY( ACT_SPELL_VM_ARM ); + REGISTER_SHARED_ACTIVITY( ACT_SPELL_VM_FIRE ); + AssertMsg( g_HighestActivity == LAST_SHARED_ACTIVITY - 1, "Not all activities from ai_activity.h registered in activitylist.cpp" ); } diff --git a/sp/src/game/shared/ai_activity.h b/sp/src/game/shared/ai_activity.h index 6c5f05c8..fbd10c39 100644 --- a/sp/src/game/shared/ai_activity.h +++ b/sp/src/game/shared/ai_activity.h @@ -2097,11 +2097,16 @@ typedef enum // Throwable Animations ACT_MP_THROW, - ACT_THROWABLE_VM_DRAW, ACT_THROWABLE_VM_IDLE, ACT_THROWABLE_VM_FIRE, + // Spell Animations + ACT_SPELL_VM_DRAW, + ACT_SPELL_VM_IDLE, + ACT_SPELL_VM_ARM, + ACT_SPELL_VM_FIRE, + // this is the end of the global activities, private per-monster activities start here. LAST_SHARED_ACTIVITY, } Activity; diff --git a/sp/src/game/shared/basecombatweapon_shared.h b/sp/src/game/shared/basecombatweapon_shared.h index d773c0c5..701403a0 100644 --- a/sp/src/game/shared/basecombatweapon_shared.h +++ b/sp/src/game/shared/basecombatweapon_shared.h @@ -248,7 +248,7 @@ public: // but they are out of ammo. The default implementation // either reloads, switches weapons, or plays an empty sound. - virtual bool ShouldBlockPrimaryFire() { return !AutoFiresFullClip(); } + virtual bool ShouldBlockPrimaryFire() { return false; } #ifdef CLIENT_DLL virtual void CreateMove( float flInputSampleTime, CUserCmd *pCmd, const QAngle &vecOldViewAngles ) {} diff --git a/sp/src/game/shared/basegrenade_shared.h b/sp/src/game/shared/basegrenade_shared.h index 79e34801..38bb684d 100644 --- a/sp/src/game/shared/basegrenade_shared.h +++ b/sp/src/game/shared/basegrenade_shared.h @@ -11,6 +11,8 @@ #pragma once #endif +#include "baseprojectile.h" + #if defined( CLIENT_DLL ) #define CBaseGrenade C_BaseGrenade @@ -29,12 +31,12 @@ class CTakeDamageInfo; #if !defined( CLIENT_DLL ) -class CBaseGrenade : public CBaseAnimating, public CDefaultPlayerPickupVPhysics +class CBaseGrenade : public CBaseProjectile, public CDefaultPlayerPickupVPhysics #else -class CBaseGrenade : public CBaseAnimating +class CBaseGrenade : public CBaseProjectile #endif { - DECLARE_CLASS( CBaseGrenade, CBaseAnimating ); + DECLARE_CLASS( CBaseGrenade, CBaseProjectile ); public: CBaseGrenade(void); diff --git a/sp/src/game/shared/baseplayer_shared.cpp b/sp/src/game/shared/baseplayer_shared.cpp index f56e72e4..cba09eb7 100644 --- a/sp/src/game/shared/baseplayer_shared.cpp +++ b/sp/src/game/shared/baseplayer_shared.cpp @@ -22,7 +22,7 @@ #include "view.h" #include "client_virtualreality.h" #define CRecipientFilter C_RecipientFilter - #include "headtrack/isourcevirtualreality.h" + #include "sourcevr/isourcevirtualreality.h" #else diff --git a/sp/src/game/shared/baseprojectile.cpp b/sp/src/game/shared/baseprojectile.cpp new file mode 100644 index 00000000..c695db93 --- /dev/null +++ b/sp/src/game/shared/baseprojectile.cpp @@ -0,0 +1,26 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#include "cbase.h" +#include "baseprojectile.h" + + +IMPLEMENT_NETWORKCLASS_ALIASED( BaseProjectile, DT_BaseProjectile ) + +BEGIN_NETWORK_TABLE( CBaseProjectile, DT_BaseProjectile ) +END_NETWORK_TABLE() + + +//----------------------------------------------------------------------------- +// Purpose: Constructor. +//----------------------------------------------------------------------------- +CBaseProjectile::CBaseProjectile() +{ +#ifdef GAME_DLL + m_iDestroyableHitCount = 0; +#endif +} diff --git a/sp/src/game/shared/baseprojectile.h b/sp/src/game/shared/baseprojectile.h new file mode 100644 index 00000000..2ff00fc5 --- /dev/null +++ b/sp/src/game/shared/baseprojectile.h @@ -0,0 +1,53 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef BASEPROJECTILE_H +#define BASEPROJECTILE_H +#ifdef _WIN32 +#pragma once +#endif + +#include "cbase.h" + +#ifdef GAME_DLL +#include "baseanimating.h" +#else +#include "c_baseanimating.h" +#endif + +#ifdef CLIENT_DLL +#define CBaseProjectile C_BaseProjectile +#endif // CLIENT_DLL + +//============================================================================= +// +// Base Projectile. +// +//============================================================================= +class CBaseProjectile : public CBaseAnimating +{ +public: + DECLARE_CLASS( CBaseProjectile, CBaseAnimating ); + DECLARE_NETWORKCLASS(); + + CBaseProjectile(); + +#ifdef GAME_DLL + virtual int GetDestroyableHitCount( void ) const { return m_iDestroyableHitCount; } + void IncrementDestroyableHitCount( void ) { ++m_iDestroyableHitCount; } +#endif // GAME_DLL + + virtual bool IsDestroyable( void ) { return false; } + virtual void Destroy( bool bBlinkOut = true, bool bBreakRocket = false ) {} + +protected: +#ifdef GAME_DLL + int m_iDestroyableHitCount; +#endif // GAME_DLL +}; + +#endif // BASEPROJECTILE_H diff --git a/sp/src/game/shared/baseviewmodel_shared.cpp b/sp/src/game/shared/baseviewmodel_shared.cpp index 99c4bfce..20538e8c 100644 --- a/sp/src/game/shared/baseviewmodel_shared.cpp +++ b/sp/src/game/shared/baseviewmodel_shared.cpp @@ -12,7 +12,7 @@ #include "iprediction.h" #include "prediction.h" #include "client_virtualreality.h" -#include "headtrack/isourcevirtualreality.h" +#include "sourcevr/isourcevirtualreality.h" #else #include "vguiscreen.h" #endif diff --git a/sp/src/game/shared/effect_color_tables.h b/sp/src/game/shared/effect_color_tables.h index 54f6384f..322d0e08 100644 --- a/sp/src/game/shared/effect_color_tables.h +++ b/sp/src/game/shared/effect_color_tables.h @@ -44,6 +44,7 @@ static colorentry_t bloodcolors[] = { BLOOD_COLOR_RED, 72, 0, 0 }, { BLOOD_COLOR_YELLOW, 195, 195, 0 }, { BLOOD_COLOR_MECH, 20, 20, 20 }, + { BLOOD_COLOR_GREEN, 195, 195, 0 }, }; #endif // EFFECT_COLOR_TABLES_H diff --git a/sp/src/game/shared/gamemovement.cpp b/sp/src/game/shared/gamemovement.cpp index 4f1132b1..8de6fc32 100644 --- a/sp/src/game/shared/gamemovement.cpp +++ b/sp/src/game/shared/gamemovement.cpp @@ -55,6 +55,12 @@ ConVar player_limit_jump_speed( "player_limit_jump_speed", "1", FCVAR_REPLICATED // duck controls. Its value is meaningless anytime we don't have the options window open. ConVar option_duck_method("option_duck_method", "1", FCVAR_REPLICATED|FCVAR_ARCHIVE );// 0 = HOLD to duck, 1 = Duck is a toggle +#ifdef STAGING_ONLY +#ifdef CLIENT_DLL +ConVar debug_latch_reset_onduck( "debug_latch_reset_onduck", "1", FCVAR_CHEAT ); +#endif +#endif + // [MD] I'll remove this eventually. For now, I want the ability to A/B the optimizations. bool g_bMovementOptimizations = true; @@ -4108,8 +4114,15 @@ void CGameMovement::FinishUnDuck( void ) mv->SetAbsOrigin( newOrigin ); #ifdef CLIENT_DLL +#ifdef STAGING_ONLY + if ( debug_latch_reset_onduck.GetBool() ) + { + player->ResetLatched(); + } +#else player->ResetLatched(); #endif +#endif // CLIENT_DLL // Recategorize position since ducking can change origin CategorizePosition(); @@ -4207,8 +4220,15 @@ void CGameMovement::FinishDuck( void ) mv->SetAbsOrigin( out ); #ifdef CLIENT_DLL +#ifdef STAGING_ONLY + if ( debug_latch_reset_onduck.GetBool() ) + { + player->ResetLatched(); + } +#else player->ResetLatched(); #endif +#endif // CLIENT_DLL } // See if we are stuck? diff --git a/sp/src/game/shared/gamerules.h b/sp/src/game/shared/gamerules.h index 6d99f64f..4b2f5124 100644 --- a/sp/src/game/shared/gamerules.h +++ b/sp/src/game/shared/gamerules.h @@ -271,7 +271,7 @@ public: // Client damage rules virtual float FlPlayerFallDamage( CBasePlayer *pPlayer ) = 0;// this client just hit the ground after a fall. How much damage? - virtual bool FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker ) {return TRUE;};// can this player take damage from this attacker? + virtual bool FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker, const CTakeDamageInfo &info ) {return TRUE;};// can this player take damage from this attacker? virtual bool ShouldAutoAim( CBasePlayer *pPlayer, edict_t *target ) { return TRUE; } virtual float GetAutoAimScale( CBasePlayer *pPlayer ) { return 1.0f; } virtual int GetAutoAimMode() { return AUTOAIM_ON; } diff --git a/sp/src/game/shared/movevars_shared.cpp b/sp/src/game/shared/movevars_shared.cpp index 3ef79945..b5b94c72 100644 --- a/sp/src/game/shared/movevars_shared.cpp +++ b/sp/src/game/shared/movevars_shared.cpp @@ -36,7 +36,7 @@ float GetCurrentGravity( void ) ConVar sv_gravity ( "sv_gravity", DEFAULT_GRAVITY_STRING, FCVAR_NOTIFY | FCVAR_REPLICATED, "World gravity." ); -#if defined( DOD_DLL ) || defined( CSTRIKE_DLL ) +#if defined( DOD_DLL ) || defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) ConVar sv_stopspeed ( "sv_stopspeed","100", FCVAR_NOTIFY | FCVAR_REPLICATED, "Minimum stopping speed when on ground." ); #else ConVar sv_stopspeed ( "sv_stopspeed","100", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Minimum stopping speed when on ground." ); @@ -48,7 +48,7 @@ ConVar sv_specaccelerate( "sv_specaccelerate", "5", FCVAR_NOTIFY | FCVAR_ARCHIVE ConVar sv_specspeed ( "sv_specspeed", "3", FCVAR_ARCHIVE | FCVAR_NOTIFY | FCVAR_REPLICATED); ConVar sv_specnoclip ( "sv_specnoclip", "1", FCVAR_ARCHIVE | FCVAR_NOTIFY | FCVAR_REPLICATED); -#if defined( CSTRIKE_DLL ) +#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) ConVar sv_maxspeed ( "sv_maxspeed", "320", FCVAR_NOTIFY | FCVAR_REPLICATED); #else ConVar sv_maxspeed ( "sv_maxspeed", "320", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY); @@ -58,7 +58,7 @@ ConVar sv_maxspeed ( "sv_maxspeed", "320", FCVAR_NOTIFY | FCVAR_REPLICATED | FC ConVar sv_accelerate ( "sv_accelerate", "7", FCVAR_NOTIFY | FCVAR_REPLICATED); #else -#if defined( CSTRIKE_DLL ) +#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) ConVar sv_accelerate ( "sv_accelerate", "10", FCVAR_NOTIFY | FCVAR_REPLICATED); #else ConVar sv_accelerate ( "sv_accelerate", "10", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY); @@ -66,7 +66,7 @@ ConVar sv_maxspeed ( "sv_maxspeed", "320", FCVAR_NOTIFY | FCVAR_REPLICATED | FC #endif//_XBOX -#if defined( CSTRIKE_DLL ) +#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) ConVar sv_airaccelerate( "sv_airaccelerate", "10", FCVAR_NOTIFY | FCVAR_REPLICATED); ConVar sv_wateraccelerate( "sv_wateraccelerate", "10", FCVAR_NOTIFY | FCVAR_REPLICATED); ConVar sv_waterfriction( "sv_waterfriction", "1", FCVAR_NOTIFY | FCVAR_REPLICATED); @@ -82,13 +82,13 @@ ConVar sv_rollspeed ( "sv_rollspeed", "200", FCVAR_NOTIFY | FCVAR_REPLICATED | F ConVar sv_rollangle ( "sv_rollangle", "0", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Max view roll angle"); #endif // CSTRIKE_DLL -#if defined( DOD_DLL ) || defined( CSTRIKE_DLL ) +#if defined( DOD_DLL ) || defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) ConVar sv_friction ( "sv_friction","4", FCVAR_NOTIFY | FCVAR_REPLICATED, "World friction." ); #else ConVar sv_friction ( "sv_friction","4", FCVAR_NOTIFY | FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "World friction." ); #endif // DOD_DLL || CSTRIKE_DLL -#if defined( CSTRIKE_DLL ) +#if defined( CSTRIKE_DLL ) || defined( HL1MP_DLL ) ConVar sv_bounce ( "sv_bounce","0", FCVAR_NOTIFY | FCVAR_REPLICATED, "Bounce multiplier for when physically simulated objects collide with other objects." ); ConVar sv_maxvelocity ( "sv_maxvelocity","3500", FCVAR_REPLICATED, "Maximum speed any ballistically moving object is allowed to attain per axis." ); ConVar sv_stepsize ( "sv_stepsize","18", FCVAR_NOTIFY | FCVAR_REPLICATED ); diff --git a/sp/src/game/shared/mp_shareddefs.cpp b/sp/src/game/shared/mp_shareddefs.cpp index 561ba6fb..b555a88f 100644 --- a/sp/src/game/shared/mp_shareddefs.cpp +++ b/sp/src/game/shared/mp_shareddefs.cpp @@ -103,7 +103,7 @@ const char *g_pszMPConcepts[] = "TLK_TAUNT_REPLAY", // MP_CONCEPT_TAUNT_REPLAY "TLK_TAUNT_LAUGH", // MP_CONCEPT_TAUNT_LAUGH "TLK_TAUNT_HEROIC_POSE", // MP_CONCEPT_TAUNT_HEROIC_POSE - "TLK_HIGHFIVE_READY", // MP_CONCEPT_HIGHFIVE_READY + "TLK_PARTNER_TAUNT_READY", // MP_CONCEPT_PARTNER_TAUNT_READY "TLK_PLAYER_HOLDTAUNT", // MP_CONCEPT_HOLDTAUNT "TLK_TAUNT_PYRO_ARMAGEDDON", // MP_CONCEPT_TAUNT_PYRO_ARMAGEDDON "TLK_ROCKET_DESTOYED", // MP_CONCEPT_ROCKET_DESTOYED @@ -144,16 +144,55 @@ const char *g_pszMPConcepts[] = "TLK_MAGIC_DANCE", // MP_CONCEPT_MAGIC_DANCE "HalloweenLongFall", // MP_CONCEPT_HALLOWEEN_LONGFALL "TLK_TAUNT_GUITAR_RIFF", // MP_CONCEPT_TAUNT_GUITAR_RIFF + + // TF Halloween 2013 shenanigans. + "TLK_PLAYER_CAST_FIREBALL", // MP_CONCEPT_PLAYER_CAST_FIREBALL + "TLK_PLAYER_CAST_MERASMUS_ZAP", // MP_CONCEPT_PLAYER_CAST_MERASMUS_ZAP + "TLK_PLAYER_CAST_SELF_HEAL", // MP_CONCEPT_PLAYER_CAST_SELF_HEAL + "TLK_PLAYER_CAST_MIRV", // MP_CONCEPT_PLAYER_CAST_MIRV + "TLK_PLAYER_CAST_BLAST_JUMP", // MP_CONCEPT_PLAYER_CAST_BLAST_JUMP + "TLK_PLAYER_CAST_STEALTH", // MP_CONCEPT_PLAYER_CAST_STEALTH + "TLK_PLAYER_CAST_TELEPORT", // MP_CONCEPT_PLAYER_CAST_TELEPORT + "TLK_PLAYER_CAST_LIGHTNING_BALL", // MP_CONCEPT_PLAYER_CAST_LIGHTNING_BALL + "TLK_PLAYER_CAST_MOVEMENT_BUFF", // MP_CONCEPT_PLAYER_CAST_MOVEMENT_BUFF + "TLK_PLAYER_CAST_MONOCULOUS", // MP_CONCEPT_PLAYER_CAST_MONOCULOUS + "TLK_PLAYER_CAST_METEOR_SWARM", // MP_CONCEPT_PLAYER_CAST_METEOR_SWARM + "TLK_PLAYER_CAST_SKELETON_HORDE", // MP_CONCEPT_PLAYER_CAST_SKELETON_HORDE + + "TLK_PLAYER_SPELL_FIREBALL", // MP_CONCEPT_PLAYER_SPELL_FIREBALL + "TLK_PLAYER_SPELL_MERASMUS_ZAP", // MP_CONCEPT_PLAYER_SPELL_MERASMUS_ZAP + "TLK_PLAYER_SPELL_SELF_HEAL", // MP_CONCEPT_PLAYER_SPELL_SELF_HEAL + "TLK_PLAYER_SPELL_MIRV", // MP_CONCEPT_PLAYER_SPELL_MIRV + "TLK_PLAYER_SPELL_BLAST_JUMP", // MP_CONCEPT_PLAYER_SPELL_BLAST_JUMP + "TLK_PLAYER_SPELL_STEALTH", // MP_CONCEPT_PLAYER_SPELL_STEALTH + "TLK_PLAYER_SPELL_TELEPORT", // MP_CONCEPT_PLAYER_SPELL_TELEPORT + "TLK_PLAYER_SPELL_LIGHTNING_BALL", // MP_CONCEPT_PLAYER_SPELL_LIGHTNING_BALL + "TLK_PLAYER_SPELL_MOVEMENT_BUFF", // MP_CONCEPT_PLAYER_SPELL_MOVEMENT_BUFF + "TLK_PLAYER_SPELL_MONOCULOUS", // MP_CONCEPT_PLAYER_SPELL_MONOCULOUS + "TLK_PLAYER_SPELL_METEOR_SWARM", // MP_CONCEPT_PLAYER_SPELL_METEOR_SWARM + "TLK_PLAYER_SPELL_SKELETON_HORDE", // MP_CONCEPT_PLAYER_SPELL_SKELETON_HORDE + + // Events. + "TLK_PLAYER_SPELL_PICKUP_COMMON", // MP_CONCEPT_PLAYER_SPELL_PICKUP_COMMON + "TLK_PLAYER_SPELL_PICKUP_RARE", // MP_CONCEPT_PLAYER_SPELL_PICKUP_RARE + "TLK_PLAYER_HELLTOWER_MIDNIGHT", // MP_CONCEPT_PLAYER_HELLTOWER_MIDNIGHT + "TLK_PLAYER_SKELETON_KING_APPEAR", // MP_CONCEPT_PLAYER_SKELETON_KING_APPEAR + + "TLK_MANNHATTAN_GATE_ATK", // MP_CONCEPT_MANNHATTAN_GATE_ATK + "TLK_MANNHATTAN_GATE_TAKE", // MP_CONCEPT_MANNHATTAN_GATE_TAKE + "TLK_RESURRECTED", // MP_CONCEPT_RESURRECTED + "TLK_MVM_LOOT_COMMON", // MP_CONCEPT_MVM_LOOT_COMMON + "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 }; +COMPILE_TIME_ASSERT( ARRAYSIZE( g_pszMPConcepts ) == MP_TF_CONCEPT_COUNT ); //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- int GetMPConceptIndexFromString( const char *pszConcept ) { - // Make sure our concept string and enum arrays are the same length - Assert( ARRAYSIZE( g_pszMPConcepts ) == MP_TF_CONCEPT_COUNT ); - for ( int iConcept = 0; iConcept < ARRAYSIZE( g_pszMPConcepts ); ++iConcept ) { if ( !Q_stricmp( pszConcept, g_pszMPConcepts[iConcept] ) ) diff --git a/sp/src/game/shared/mp_shareddefs.h b/sp/src/game/shared/mp_shareddefs.h index bb173c52..8ad6011b 100644 --- a/sp/src/game/shared/mp_shareddefs.h +++ b/sp/src/game/shared/mp_shareddefs.h @@ -112,7 +112,7 @@ enum MP_CONCEPT_TAUNT_REPLAY, // "TLK_TAUNT_REPLAY" MP_CONCEPT_TAUNT_LAUGH, // "TLK_TAUNT_LAUGH" MP_CONCEPT_TAUNT_HEROIC_POSE, // "TLK_TAUNT_HEROIC_POSE" - MP_CONCEPT_HIGHFIVE_READY, // "TLK_HIGHFIVE_READY" + MP_CONCEPT_PARTNER_TAUNT_READY, // "TLK_PARTNER_TAUNT_READY" MP_CONCEPT_HOLDTAUNT, // "TLK_PLAYER_HOLDTAUNT" MP_CONCEPT_TAUNT_PYRO_ARMAGEDDON, // "TLK_TAUNT_PYRO_ARMAGEDDON" MP_CONCEPT_ROCKET_DESTOYED, // "TLK_ROCKET_DESTOYED" @@ -153,6 +153,48 @@ enum MP_CONCEPT_MAGIC_DANCE, // "TLK_MAGIC_DANCE" MP_CONCEPT_HALLOWEEN_LONGFALL, MP_CONCEPT_TAUNT_GUITAR_RIFF, // "TLK_TAUNT_GUITAR_RIFF" + + // TF Halloween 2013 shenanigans. + MP_CONCEPT_PLAYER_CAST_FIREBALL, // "TLK_PLAYER_CAST_FIREBALL" + MP_CONCEPT_PLAYER_CAST_MERASMUS_ZAP, // "TLK_PLAYER_CAST_MERASMUS_ZAP" + MP_CONCEPT_PLAYER_CAST_SELF_HEAL, // "TLK_PLAYER_CAST_SELF_HEAL" + MP_CONCEPT_PLAYER_CAST_MIRV, // "TLK_PLAYER_CAST_MIRV" + MP_CONCEPT_PLAYER_CAST_BLAST_JUMP, // "TLK_PLAYER_CAST_BLAST_JUMP" + MP_CONCEPT_PLAYER_CAST_STEALTH, // "TLK_PLAYER_CAST_STEALTH" + MP_CONCEPT_PLAYER_CAST_TELEPORT, // "TLK_PLAYER_CAST_TELEPORT" + MP_CONCEPT_PLAYER_CAST_LIGHTNING_BALL, // "TLK_PLAYER_CAST_LIGHTNING_BALL" + MP_CONCEPT_PLAYER_CAST_MOVEMENT_BUFF, // "TLK_PLAYER_CAST_MOVEMENT_BUFF" + MP_CONCEPT_PLAYER_CAST_MONOCULOUS, // "TLK_PLAYER_CAST_MONOCULOUS" + MP_CONCEPT_PLAYER_CAST_METEOR_SWARM, // "TLK_PLAYER_CAST_METEOR_SWARM" + MP_CONCEPT_PLAYER_CAST_SKELETON_HORDE, // "TLK_PLAYER_CAST_SKELETON_HORDE" + + MP_CONCEPT_PLAYER_SPELL_FIREBALL, // "TLK_PLAYER_SPELL_FIREBALL" + MP_CONCEPT_PLAYER_SPELL_MERASMUS_ZAP, // "TLK_PLAYER_SPELL_MERASMUS_ZAP" + MP_CONCEPT_PLAYER_SPELL_SELF_HEAL, // "TLK_PLAYER_SPELL_SELF_HEAL" + MP_CONCEPT_PLAYER_SPELL_MIRV, // "TLK_PLAYER_SPELL_MIRV" + MP_CONCEPT_PLAYER_SPELL_BLAST_JUMP, // "TLK_PLAYER_SPELL_BLAST_JUMP" + MP_CONCEPT_PLAYER_SPELL_STEALTH, // "TLK_PLAYER_SPELL_STEALTH" + MP_CONCEPT_PLAYER_SPELL_TELEPORT, // "TLK_PLAYER_SPELL_TELEPORT" + MP_CONCEPT_PLAYER_SPELL_LIGHTNING_BALL, // "TLK_PLAYER_SPELL_LIGHTNING_BALL" + MP_CONCEPT_PLAYER_SPELL_MOVEMENT_BUFF, // "TLK_PLAYER_SPELL_MOVEMENT_BUFF" + MP_CONCEPT_PLAYER_SPELL_MONOCULOUS, // "TLK_PLAYER_SPELL_MONOCULOUS" + MP_CONCEPT_PLAYER_SPELL_METEOR_SWARM, // "TLK_PLAYER_SPELL_METEOR_SWARM" + MP_CONCEPT_PLAYER_SPELL_SKELETON_HORDE, // "TLK_PLAYER_SPELL_SKELETON_HORDE" + + // Events. + MP_CONCEPT_PLAYER_SPELL_PICKUP_COMMON, // "TLK_PLAYER_SPELL_PICKUP_COMMON" + MP_CONCEPT_PLAYER_SPELL_PICKUP_RARE, // "TLK_PLAYER_SPELL_PICKUP_RARE" + MP_CONCEPT_PLAYER_HELLTOWER_MIDNIGHT, // "TLK_PLAYER_HELLTOWER_MIDNIGHT" + MP_CONCEPT_PLAYER_SKELETON_KING_APPEAR, // "TLK_PLAYER_SKELETON_KING_APPEAR" + + MP_CONCEPT_MANNHATTAN_GATE_ATK, // "TLK_MANNHATTAN_GATE_ATK" + MP_CONCEPT_MANNHATTAN_GATE_TAKE, // "TLK_MANNHATTAN_GATE_TAKE" + MP_CONCEPT_RESURRECTED, // "TLK_RESURRECTED" + MP_CONCEPT_MVM_LOOT_COMMON, // "TLK_MVM_LOOT_COMMON" + MP_CONCEPT_MVM_LOOT_RARE, // "TLK_MVM_LOOT_RARE" + MP_CONCEPT_MVM_LOOT_ULTRARARE, // "TLK_MVM_LOOT_ULTRARARE" + MP_CONCEPT_MEDIC_HEAL_SHIELD, // "TLK_MEDIC_HEAL_SHIELD" + MP_TF_CONCEPT_COUNT // Other MP_CONCEPT_* start he using MP_TF_CONCEPT_COUNT + 1 as start. diff --git a/sp/src/game/shared/multiplay_gamerules.cpp b/sp/src/game/shared/multiplay_gamerules.cpp index 409f2362..07932e92 100644 --- a/sp/src/game/shared/multiplay_gamerules.cpp +++ b/sp/src/game/shared/multiplay_gamerules.cpp @@ -641,7 +641,7 @@ ConVarRef suitcharger( "sk_suitcharger" ); //========================================================= //========================================================= - bool CMultiplayRules::FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker ) + bool CMultiplayRules::FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker, const CTakeDamageInfo &info ) { return true; } @@ -834,7 +834,11 @@ ConVarRef suitcharger( "sk_suitcharger" ); // If the inflictor is the killer, then it must be their current weapon doing the damage if ( pScorer->GetActiveWeapon() ) { +#ifdef HL1MP_DLL + killer_weapon_name = pScorer->GetActiveWeapon()->GetClassname(); +#else killer_weapon_name = pScorer->GetActiveWeapon()->GetDeathNoticeName(); +#endif } } else @@ -870,7 +874,9 @@ ConVarRef suitcharger( "sk_suitcharger" ); event->SetInt("attacker", killer_ID ); event->SetInt("customkill", info.GetDamageCustom() ); event->SetInt("priority", 7 ); // HLTV event priority, not transmitted - +#ifdef HL1MP_DLL + event->SetString("weapon", killer_weapon_name ); +#endif gameeventmanager->FireEvent( event ); } @@ -1748,6 +1754,37 @@ ConVarRef suitcharger( "sk_suitcharger" ); } } + void CMultiplayRules::RandomPlayersSpeakConceptIfAllowed( int iConcept, int iNumRandomPlayer /*= 1*/, int iTeam /*= TEAM_UNASSIGNED*/, const char *modifiers /*= NULL*/ ) + { + CUtlVector< CBaseMultiplayerPlayer* > speakCandidates; + + CBaseMultiplayerPlayer *pPlayer; + for ( int i = 1; i <= gpGlobals->maxClients; i++ ) + { + pPlayer = ToBaseMultiplayerPlayer( UTIL_PlayerByIndex( i ) ); + + if ( !pPlayer ) + continue; + + if ( iTeam != TEAM_UNASSIGNED ) + { + if ( pPlayer->GetTeamNumber() != iTeam ) + continue; + } + + speakCandidates.AddToTail( pPlayer ); + } + + int iSpeaker = iNumRandomPlayer; + while ( iSpeaker > 0 && speakCandidates.Count() > 0 ) + { + int iRandomSpeaker = RandomInt( 0, speakCandidates.Count() - 1 ); + speakCandidates[ iRandomSpeaker ]->SpeakConceptIfAllowed( iConcept, modifiers ); + speakCandidates.FastRemove( iRandomSpeaker ); + iSpeaker--; + } + } + void CMultiplayRules::ClientSettingsChanged( CBasePlayer *pPlayer ) { // NVNT see if this user is still or has began using a haptic device diff --git a/sp/src/game/shared/multiplay_gamerules.h b/sp/src/game/shared/multiplay_gamerules.h index 4512c9c9..08e06e4a 100644 --- a/sp/src/game/shared/multiplay_gamerules.h +++ b/sp/src/game/shared/multiplay_gamerules.h @@ -136,7 +136,7 @@ public: // Client damage rules virtual float FlPlayerFallDamage( CBasePlayer *pPlayer ); - virtual bool FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker ); + virtual bool FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker, const CTakeDamageInfo &info ); virtual bool AllowDamage( CBaseEntity *pVictim, const CTakeDamageInfo &info ); // Client spawn/respawn control @@ -215,6 +215,7 @@ public: void IncrementMapCycleIndex(); void HaveAllPlayersSpeakConceptIfAllowed( int iConcept, int iTeam = TEAM_UNASSIGNED, const char *modifiers = NULL ); + void RandomPlayersSpeakConceptIfAllowed( int iConcept, int iNumRandomPlayer = 1, int iTeam = TEAM_UNASSIGNED, const char *modifiers = NULL ); virtual void GetTaggedConVarList( KeyValues *pCvarTagList ); diff --git a/sp/src/game/shared/particle_property.cpp b/sp/src/game/shared/particle_property.cpp index e5a5487d..8ddc9784 100644 --- a/sp/src/game/shared/particle_property.cpp +++ b/sp/src/game/shared/particle_property.cpp @@ -557,6 +557,14 @@ void CParticleProperty::UpdateControlPoint( ParticleEffectList_t *pEffect, int i if ( bUseHeadOrigin > 0 ) { int iBone = Studio_BoneIndexByName( pAnimating->GetModelPtr(), "bip_head" ); + if ( iBone < 0 ) + { + iBone = Studio_BoneIndexByName( pAnimating->GetModelPtr(), "prp_helmet" ); + if ( iBone < 0 ) + { + iBone = Studio_BoneIndexByName( pAnimating->GetModelPtr(), "prp_hat" ); + } + } if ( iBone >= 0 ) { bUsingHeadOrigin = true; @@ -587,18 +595,23 @@ void CParticleProperty::UpdateControlPoint( ParticleEffectList_t *pEffect, int i if ( !pAnimating->GetAttachment( pPoint->iAttachmentPoint, attachmentToWorld ) ) { - Warning( "Cannot update control point %d for effect '%s'.\n", pPoint->iAttachmentPoint, pEffect->pParticleEffect->GetEffectName() ); - attachmentToWorld = pAnimating->RenderableToWorldTransform(); + // try C_BaseAnimating if attach point is not on the weapon + if ( !pAnimating->C_BaseAnimating::GetAttachment( pPoint->iAttachmentPoint, attachmentToWorld ) ) + { + Warning( "Cannot update control point %d for effect '%s'.\n", pPoint->iAttachmentPoint, pEffect->pParticleEffect->GetEffectName() ); + attachmentToWorld = pAnimating->RenderableToWorldTransform(); + } } - MatrixVectors( attachmentToWorld, &vecForward, &vecRight, &vecUp ); - MatrixPosition( attachmentToWorld, vecOrigin ); + VMatrix vMat(attachmentToWorld); + MatrixTranslate( vMat, pPoint->vecOriginOffset ); + MatrixVectors( vMat.As3x4(), &vecForward, &vecRight, &vecUp ); + MatrixPosition( vMat.As3x4(), vecOrigin ); if ( pEffect->pParticleEffect->m_pDef->IsViewModelEffect() ) { FormatViewModelAttachment( vecOrigin, true ); } - } } break; diff --git a/sp/src/game/shared/props_shared.cpp b/sp/src/game/shared/props_shared.cpp index 7cf4489b..6d0f9209 100644 --- a/sp/src/game/shared/props_shared.cpp +++ b/sp/src/game/shared/props_shared.cpp @@ -1323,7 +1323,7 @@ CBaseEntity *CreateGibsFromList( CUtlVector<breakmodel_t> &list, int modelindex, if ( !pCollide ) return NULL; - int nSkin = 0; + int nSkin = params.nDefaultSkin; CBaseEntity *pOwnerEntity = pEntity; CBaseAnimating *pOwnerAnim = NULL; if ( pPhysics ) diff --git a/sp/src/game/shared/props_shared.h b/sp/src/game/shared/props_shared.h index ee849ed2..c63cb212 100644 --- a/sp/src/game/shared/props_shared.h +++ b/sp/src/game/shared/props_shared.h @@ -227,6 +227,7 @@ struct breakablepropparams_t impactEnergyScale = 0; defBurstScale = 0; defCollisionGroup = COLLISION_GROUP_NONE; + nDefaultSkin = 0; } const Vector &origin; @@ -236,6 +237,7 @@ struct breakablepropparams_t float impactEnergyScale; float defBurstScale; int defCollisionGroup; + int nDefaultSkin; }; const char *GetMassEquivalent(float flMass); diff --git a/sp/src/game/shared/shareddefs.h b/sp/src/game/shared/shareddefs.h index b7103be3..842d2f06 100644 --- a/sp/src/game/shared/shareddefs.h +++ b/sp/src/game/shared/shareddefs.h @@ -151,8 +151,20 @@ typedef enum VOTE_FAILED_MAP_NOT_VALID, VOTE_FAILED_CANNOT_KICK_FOR_TIME, VOTE_FAILED_CANNOT_KICK_DURING_ROUND, + + // TF-specific? + VOTE_FAILED_MODIFICATION_ALREADY_ACTIVE, } vote_create_failed_t; +enum +{ +#ifdef STAGING_ONLY + SERVER_MODIFICATION_ITEM_DURATION_IN_MINUTES = 2 +#else + SERVER_MODIFICATION_ITEM_DURATION_IN_MINUTES = 120 +#endif +}; + #define MAX_VOTE_DETAILS_LENGTH 64 #define INVALID_ISSUE -1 #define MAX_VOTE_OPTIONS 5 diff --git a/sp/src/game/shared/takedamageinfo.cpp b/sp/src/game/shared/takedamageinfo.cpp index e83878cf..e9062d80 100644 --- a/sp/src/game/shared/takedamageinfo.cpp +++ b/sp/src/game/shared/takedamageinfo.cpp @@ -58,9 +58,9 @@ void CTakeDamageInfo::Init( CBaseEntity *pInflictor, CBaseEntity *pAttacker, CBa m_vecReportedPosition = reportedPosition; m_iAmmoType = -1; m_iDamagedOtherPlayers = 0; - m_iPlayerPenetrationCount = 0; m_flDamageBonus = 0.f; + m_bForceFriendlyFire = false; } CTakeDamageInfo::CTakeDamageInfo() diff --git a/sp/src/game/shared/takedamageinfo.h b/sp/src/game/shared/takedamageinfo.h index a4c01826..702e9322 100644 --- a/sp/src/game/shared/takedamageinfo.h +++ b/sp/src/game/shared/takedamageinfo.h @@ -77,6 +77,8 @@ public: void SetDamageCustom( int iDamageCustom ); int GetDamageStats( void ) const; void SetDamageStats( int iDamageStats ); + void SetForceFriendlyFire( bool bValue ) { m_bForceFriendlyFire = bValue; } + bool IsForceFriendlyFire( void ) const { return m_bForceFriendlyFire; } int GetAmmoType() const; void SetAmmoType( int iAmmoType ); @@ -123,6 +125,7 @@ protected: int m_iDamagedOtherPlayers; int m_iPlayerPenetrationCount; float m_flDamageBonus; // Anything that increases damage (crit) - store the delta + bool m_bForceFriendlyFire; // Ideally this would be a dmg type, but we can't add more DECLARE_SIMPLE_DATADESC(); }; diff --git a/sp/src/game/shared/teamplay_gamerules.cpp b/sp/src/game/shared/teamplay_gamerules.cpp index 1cbe368a..171313b3 100644 --- a/sp/src/game/shared/teamplay_gamerules.cpp +++ b/sp/src/game/shared/teamplay_gamerules.cpp @@ -352,9 +352,9 @@ bool CTeamplayRules::IsTeamplay( void ) return true; } -bool CTeamplayRules::FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker ) +bool CTeamplayRules::FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker, const CTakeDamageInfo &info ) { - if ( pAttacker && PlayerRelationship( pPlayer, pAttacker ) == GR_TEAMMATE ) + if ( pAttacker && PlayerRelationship( pPlayer, pAttacker ) == GR_TEAMMATE && !info.IsForceFriendlyFire() ) { // my teammate hit me. if ( (friendlyfire.GetInt() == 0) && (pAttacker != pPlayer) ) @@ -364,7 +364,7 @@ bool CTeamplayRules::FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pA } } - return BaseClass::FPlayerCanTakeDamage( pPlayer, pAttacker ); + return BaseClass::FPlayerCanTakeDamage( pPlayer, pAttacker, info ); } //========================================================= diff --git a/sp/src/game/shared/teamplay_gamerules.h b/sp/src/game/shared/teamplay_gamerules.h index 10f953e1..952895eb 100644 --- a/sp/src/game/shared/teamplay_gamerules.h +++ b/sp/src/game/shared/teamplay_gamerules.h @@ -67,7 +67,7 @@ public: virtual bool ClientCommand( CBaseEntity *pEdict, const CCommand &args ); virtual void ClientSettingsChanged( CBasePlayer *pPlayer ); virtual bool IsTeamplay( void ); - virtual bool FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker ); + virtual bool FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker, const CTakeDamageInfo &info ); virtual int PlayerRelationship( CBaseEntity *pPlayer, CBaseEntity *pTarget ); virtual bool PlayerCanHearChat( CBasePlayer *pListener, CBasePlayer *pSpeaker ); virtual const char *GetTeamID( CBaseEntity *pEntity ); diff --git a/sp/src/game/shared/teamplay_round_timer.cpp b/sp/src/game/shared/teamplay_round_timer.cpp index 63098cd6..f993749a 100644 --- a/sp/src/game/shared/teamplay_round_timer.cpp +++ b/sp/src/game/shared/teamplay_round_timer.cpp @@ -636,6 +636,12 @@ const char *CTeamRoundTimer::GetTimeWarningSound( int nWarning ) //----------------------------------------------------------------------------- void CTeamRoundTimer::SendTimeWarning( int nWarning ) { +#if defined( TF_CLIENT_DLL ) + // don't play any time warnings for Helltower + if ( TFGameRules() && TFGameRules()->IsHalloweenScenario( CTFGameRules::HALLOWEEN_SCENARIO_HIGHTOWER ) ) + return; +#endif + // don't play sounds if the level designer has turned them off or if it's during the WaitingForPlayers time if ( !m_bTimerPaused && m_bAutoCountdown && !TeamplayRoundBasedRules()->IsInWaitingForPlayers() ) { diff --git a/sp/src/game/shared/teamplayroundbased_gamerules.cpp b/sp/src/game/shared/teamplayroundbased_gamerules.cpp index 38f1294d..26a75b18 100644 --- a/sp/src/game/shared/teamplayroundbased_gamerules.cpp +++ b/sp/src/game/shared/teamplayroundbased_gamerules.cpp @@ -1267,7 +1267,7 @@ CGameRulesRoundStateInfo* CTeamplayRoundBasedRules::State_LookupInfo( gamerules_ { GR_STATE_INIT, "GR_STATE_INIT", &CTeamplayRoundBasedRules::State_Enter_INIT, NULL, &CTeamplayRoundBasedRules::State_Think_INIT }, { GR_STATE_PREGAME, "GR_STATE_PREGAME", &CTeamplayRoundBasedRules::State_Enter_PREGAME, NULL, &CTeamplayRoundBasedRules::State_Think_PREGAME }, { GR_STATE_STARTGAME, "GR_STATE_STARTGAME", &CTeamplayRoundBasedRules::State_Enter_STARTGAME, NULL, &CTeamplayRoundBasedRules::State_Think_STARTGAME }, - { GR_STATE_PREROUND, "GR_STATE_PREROUND", &CTeamplayRoundBasedRules::State_Enter_PREROUND, NULL, &CTeamplayRoundBasedRules::State_Think_PREROUND }, + { GR_STATE_PREROUND, "GR_STATE_PREROUND", &CTeamplayRoundBasedRules::State_Enter_PREROUND, &CTeamplayRoundBasedRules::State_Leave_PREROUND, &CTeamplayRoundBasedRules::State_Think_PREROUND }, { GR_STATE_RND_RUNNING, "GR_STATE_RND_RUNNING", &CTeamplayRoundBasedRules::State_Enter_RND_RUNNING, NULL, &CTeamplayRoundBasedRules::State_Think_RND_RUNNING }, { GR_STATE_TEAM_WIN, "GR_STATE_TEAM_WIN", &CTeamplayRoundBasedRules::State_Enter_TEAM_WIN, NULL, &CTeamplayRoundBasedRules::State_Think_TEAM_WIN }, { GR_STATE_RESTART, "GR_STATE_RESTART", &CTeamplayRoundBasedRules::State_Enter_RESTART, NULL, &CTeamplayRoundBasedRules::State_Think_RESTART }, @@ -1427,6 +1427,14 @@ void CTeamplayRoundBasedRules::State_Enter_PREROUND( void ) //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- +void CTeamplayRoundBasedRules::State_Leave_PREROUND( void ) +{ + PreRound_End(); +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- void CTeamplayRoundBasedRules::State_Think_PREROUND( void ) { if( gpGlobals->curtime > m_flStateTransitionTime ) @@ -2159,6 +2167,7 @@ void CTeamplayRoundBasedRules::SetWinningTeam( int team, int iWinReason, bool bF if ( event ) { event->SetInt( "team", team ); + event->SetInt( "winreason", iWinReason ); event->SetBool( "full_round", bForceMapReset ); event->SetFloat( "round_time", gpGlobals->curtime - m_flRoundStartTime ); event->SetBool( "was_sudden_death", bWasSuddenDeath ); @@ -3062,11 +3071,11 @@ void CTeamplayRoundBasedRules::PlayWinSong( int team ) { if ( i == team ) { - BroadcastSound( i, "Game.YourTeamWon" ); + BroadcastSound( i, WinSongName( i ) ); } else { - const char *pchLoseSong = LoseSongName(); + const char *pchLoseSong = LoseSongName( i ); if ( pchLoseSong ) { BroadcastSound( i, pchLoseSong ); @@ -3094,11 +3103,11 @@ void CTeamplayRoundBasedRules::PlaySuddenDeathSong( void ) //----------------------------------------------------------------------------- void CTeamplayRoundBasedRules::PlayStalemateSong( void ) { - BroadcastSound( TEAM_UNASSIGNED, "Game.Stalemate" ); + BroadcastSound( TEAM_UNASSIGNED, GetStalemateSong( TEAM_UNASSIGNED ) ); for ( int i = FIRST_GAME_TEAM; i < GetNumberOfTeams(); i++ ) { - BroadcastSound( i, "Game.Stalemate" ); + BroadcastSound( i, GetStalemateSong( i ) ); } } diff --git a/sp/src/game/shared/teamplayroundbased_gamerules.h b/sp/src/game/shared/teamplayroundbased_gamerules.h index 61567d49..cf584092 100644 --- a/sp/src/game/shared/teamplayroundbased_gamerules.h +++ b/sp/src/game/shared/teamplayroundbased_gamerules.h @@ -297,6 +297,8 @@ public: virtual void BetweenRounds_End( void ) { return; } virtual void BetweenRounds_Think( void ) { return; } + virtual void PreRound_End( void ) { return; } + bool PrevRoundWasWaitingForPlayers() { return m_bPrevRoundWasWaitingForPlayers; } virtual bool ShouldScorePerRound( void ){ return true; } @@ -415,6 +417,7 @@ protected: void State_Think_STARTGAME( void ); void State_Enter_PREROUND( void ); + void State_Leave_PREROUND( void ); void State_Think_PREROUND( void ); void State_Enter_RND_RUNNING( void ); @@ -456,7 +459,9 @@ protected: void PlayStalemateSong( void ); void PlaySuddenDeathSong( void ); - virtual const char* LoseSongName( void ) { return "Game.YourTeamLost"; } + virtual const char* GetStalemateSong( int nTeam ) { return "Game.Stalemate"; } + virtual const char* WinSongName( int nTeam ) { return "Game.YourTeamWon"; } + virtual const char* LoseSongName( int nTeam ) { return "Game.YourTeamLost"; } virtual void RespawnTeam( int iTeam ) { RespawnPlayers( false, true, iTeam ); } diff --git a/sp/src/game/shared/voice_banmgr.cpp b/sp/src/game/shared/voice_banmgr.cpp index 7f4864d7..d362d58f 100644 --- a/sp/src/game/shared/voice_banmgr.cpp +++ b/sp/src/game/shared/voice_banmgr.cpp @@ -54,11 +54,9 @@ bool CVoiceBanMgr::Init(const char *pGameDir) { int version; filesystem->Read(&version, sizeof(version), fh); - if(version == BANMGR_FILEVERSION) + if(version == BANMGR_FILEVERSION && filesystem->Size(fh) > 4 ) { - filesystem->Seek(fh, 0, FILESYSTEM_SEEK_TAIL); - int nIDs = (filesystem->Tell(fh) - sizeof(version)) / SIGNED_GUID_LEN; - filesystem->Seek(fh, sizeof(version), FILESYSTEM_SEEK_CURRENT); + int nIDs = ( filesystem->Size( fh ) - sizeof(version)) / SIGNED_GUID_LEN; for(int i=0; i < nIDs; i++) { |