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/multiplay_gamerules.cpp | |
| 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/multiplay_gamerules.cpp')
| -rw-r--r-- | sp/src/game/shared/multiplay_gamerules.cpp | 41 |
1 files changed, 39 insertions, 2 deletions
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 |