Skip to content

Commit

Permalink
TF2V 3.1.1
Browse files Browse the repository at this point in the history
Changelog:
+Fixed a bug where domination counts could excede the maximum value of 16 (caused crashes on Linux)
+Alarm siren will now play at the beginning of arena rounds
+Arena will now activate points properly, with a 60 second grace period before unlocking (yes, this does fix the cap on arena_nucleus)
+Fixed spies being able to destroy their own sappers (needs testing)
+Engineers can no longer pick up sapped buildings
+Fixed players receiving assists on self-destructs

More to come soon
  • Loading branch information
bachingo committed Feb 27, 2018
1 parent 3993a07 commit b50cef9
Show file tree
Hide file tree
Showing 15 changed files with 98 additions and 55 deletions.
Binary file modified game/tf2classic/bin/client_srv.so
Binary file not shown.
Binary file modified src/game/client/Debug_tf2classic/vc120.pdb
Binary file not shown.
Binary file modified src/game/client/Release_tf2classic/vc120.pdb
Binary file not shown.
3 changes: 2 additions & 1 deletion src/game/client/hud_controlpointicons.cpp
Expand Up @@ -1837,7 +1837,8 @@ void CControlPointCountdown::OnTick( void )
{
if ( TeamplayRoundBasedRules()->IsInWaitingForPlayers() || TeamplayRoundBasedRules()->State_Get() != GR_STATE_RND_RUNNING )
{
return;
if (!(TeamplayRoundBasedRules()->State_Get() == GR_STATE_STALEMATE && TeamplayGameRules()->GetGameType() == TF_GAMETYPE_ARENA))
return;
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/game/client/tf/vgui/tf_clientscoreboard.cpp
Expand Up @@ -109,7 +109,7 @@ void CTFClientScoreBoardDialog::ApplySchemeSettings( vgui::IScheme *pScheme )
m_iImageDominated = m_pImageList->AddImage( scheme()->GetImage( "../hud/leaderboard_dominated", true ) );
m_iImageNemesis = m_pImageList->AddImage( scheme()->GetImage( "../hud/leaderboard_nemesis", true ) );

for (int i = 0; i < MAX_PLAYERS / 2; i++)
for (int i = 0; i < MAX_DOMINATIONS; i++)
{
m_iImageDominating[i] = m_pImageList->AddImage(scheme()->GetImage(g_aDominationEmblems[i], true));
}
Expand Down Expand Up @@ -552,7 +552,10 @@ void CTFClientScoreBoardDialog::UpdatePlayerList( void )
int domCount = tf_PR->GetDominations(playerIndex);
if (domCount > 0)
{
pKeyValues->SetInt( "dominating", m_iImageDominating[domCount-1] );
if (domCount <= MAX_DOMINATIONS)
pKeyValues->SetInt( "dominating", m_iImageDominating[domCount-1] );
else
pKeyValues->SetInt("dominating", m_iImageDominating[MAX_DOMINATIONS-1]);
}

// display whether player is alive or dead (all players see this for all other players on both teams)
Expand Down
4 changes: 3 additions & 1 deletion src/game/client/tf/vgui/tf_clientscoreboard.h
Expand Up @@ -16,6 +16,8 @@
#include "tf_hud_playerstatus.h"
#include "clientscoreboarddialog.h"

#define MAX_DOMINATIONS 16

bool AreEnemyTeams(int iTeam1, int iTeam2);
const wchar_t *GetPointsString(int iPoints);

Expand Down Expand Up @@ -79,7 +81,7 @@ class CTFClientScoreBoardDialog : public CClientScoreBoardDialog
int m_iImageDead;
int m_iImageDominated;
int m_iImageNemesis;
int m_iImageDominating[MAX_PLAYERS / 2];
int m_iImageDominating[MAX_DOMINATIONS];
int m_iClassEmblem[TF_CLASS_COUNT_ALL];
int m_iClassEmblemDead[TF_CLASS_COUNT_ALL];

Expand Down
Binary file modified src/game/server/Debug_tf2classic/vc120.pdb
Binary file not shown.
Binary file modified src/game/server/Release_tf2classic/vc120.pdb
Binary file not shown.
12 changes: 7 additions & 5 deletions src/game/server/team_control_point.cpp
Expand Up @@ -1115,12 +1115,14 @@ void CTeamControlPoint::InputSetUnlockTime( inputdata_t &inputdata )
//-----------------------------------------------------------------------------
void CTeamControlPoint::UnlockThink( void )
{
if ( m_flUnlockTime > 0 &&
m_flUnlockTime < gpGlobals->curtime &&
( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->State_Get() == GR_STATE_RND_RUNNING ) )
if (m_flUnlockTime > 0 && m_flUnlockTime < gpGlobals->curtime && TeamplayRoundBasedRules())
{
InternalSetLocked( false );
return;
if ((TeamplayGameRules()->GetGameType() == TF_GAMETYPE_ARENA && TeamplayRoundBasedRules()->State_Get() == GR_STATE_STALEMATE)
|| (TeamplayRoundBasedRules()->State_Get() == GR_STATE_RND_RUNNING))
{
InternalSetLocked(false);
return;
}
}

SetContextThink( &CTeamControlPoint::UnlockThink, gpGlobals->curtime + 0.1, CONTROL_POINT_UNLOCK_THINK );
Expand Down
16 changes: 10 additions & 6 deletions src/game/server/tf/tf_obj_sapper.cpp
Expand Up @@ -267,13 +267,17 @@ void CObjectSapper::Killed(const CTakeDamageInfo &info)
// If the sapper is removed by someone other than builder, award bonus points.
CTFPlayer *pScorer = ToTFPlayer(TFGameRules()->GetDeathScorer(info.GetAttacker(), info.GetInflictor(), this));
if (pScorer)
{
CBaseObject *pObject = GetParentObject();
if (pObject && pScorer != pObject->GetBuilder())
{
CTF_GameStats.Event_PlayerAwardBonusPoints(pScorer, this, 1);
{
CBaseObject *pObject = GetParentObject();
if (pScorer->GetTeamNumber() != pObject->GetBuilder()->GetTeamNumber())
{
return;
}
if (pObject && pScorer != pObject->GetBuilder())
{
CTF_GameStats.Event_PlayerAwardBonusPoints(pScorer, this, 1);
}
}
}

BaseClass::Killed(info);
}
Expand Down
108 changes: 68 additions & 40 deletions src/game/shared/tf/tf_gamerules.cpp
Expand Up @@ -761,77 +761,94 @@ void CTFLogicVIP::Spawn(void)
class CArenaLogic : public CBaseEntity
{
public:
DECLARE_CLASS( CArenaLogic, CBaseEntity );
DECLARE_CLASS(CArenaLogic, CBaseEntity);
DECLARE_DATADESC();

CArenaLogic();

void Spawn( void );
void ArenaLogicThink( void );
void Spawn(void);
void FireOnCapEnabled(void);
//void ArenaLogicThink(void);

virtual void InputRoundActivate(inputdata_t &inputdata);

COutputEvent m_OnArenaRoundStart;
//COutputEvent m_OnArenaRoundStart;
COutputEvent m_OnCapEnabled;

private:
float m_flCapEnableDelay;
bool m_bCapUnlocked;
int m_iUnlockPoint;
bool m_bCapUnlocked;

COutputEvent m_OnCapEnabled;
};

BEGIN_DATADESC( CArenaLogic )

DEFINE_KEYFIELD( m_flCapEnableDelay, FIELD_FLOAT, "CapEnableDelay" ),
DEFINE_KEYFIELD(m_iUnlockPoint, FIELD_INTEGER, "unlock_point"),

// Outputs
DEFINE_OUTPUT( m_OnArenaRoundStart, "OnArenaRoundStart" ),
DEFINE_OUTPUT( m_OnCapEnabled, "OnCapEnabled" ),
DEFINE_INPUTFUNC(FIELD_VOID, "RoundActivate", InputRoundActivate),

DEFINE_THINKFUNC( ArenaLogicThink ),
//DEFINE_OUTPUT(m_OnArenaRoundStart, "OnArenaRoundStart"),
DEFINE_OUTPUT(m_OnCapEnabled, "OnCapEnabled"),

//DEFINE_THINKFUNC(ArenaLogicThink),

END_DATADESC()

LINK_ENTITY_TO_CLASS( tf_logic_arena, CArenaLogic );

CArenaLogic::CArenaLogic()
{
m_flCapEnableDelay = 0.0f;
m_iUnlockPoint = 60;
m_bCapUnlocked = false;
}

void CArenaLogic::Spawn( void )
void CArenaLogic::Spawn(void)
{
BaseClass::Spawn();
#if 0
SetThink( &CArenaLogic::ArenaLogicThink );
SetNextThink( gpGlobals->curtime );
#endif
//SetThink(&CArenaLogic::ArenaLogicThink);
//SetNextThink(gpGlobals->curtime);
}

void CArenaLogic::FireOnCapEnabled(void)
{
if (m_bCapUnlocked == false)
{
m_bCapUnlocked = true;
m_OnCapEnabled.FireOutput(this, this);
}
}

void CArenaLogic::ArenaLogicThink( void )
/*void CArenaLogic::ArenaLogicThink(void)
{
// Live TF2 checks m_fCapEnableTime from TFGameRules here.
SetNextThink( gpGlobals->curtime + 0.1 );
SetNextThink(gpGlobals->curtime + 0.1);
#ifdef GAME_DLL
if ( TFGameRules()->State_Get() == GR_STATE_STALEMATE )
if (TFGameRules()->State_Get() == GR_STATE_STALEMATE)
{
float flElapsedTime = gpGlobals->curtime - TFGameRules()->GetRoundStartTime();
for (int m_iCapIndex = 0; m_iCapIndex < ObjectiveResource()->GetNumControlPoints(); m_iCapIndex++)
{
if (ObjectiveResource()->GetCPLocked(m_iCapIndex) && flElapsedTime < 60.0)
{
m_bCapUnlocked = false;
}
else if (!m_bCapUnlocked)
{
m_bCapUnlocked = true;
m_OnCapEnabled.FireOutput(this, this);
}
}
}
#endif
}
}*/

void CArenaLogic::InputRoundActivate(inputdata_t &inputdata)
{
CTeamControlPointMaster *pMaster = g_hControlPointMasters.Count() ? g_hControlPointMasters[0] : NULL;
if (!pMaster)
return;

for (int i = 0; i < pMaster->GetNumPoints(); i++)
{
CTeamControlPoint *pPoint = pMaster->GetControlPoint(i);

variant_t sVariant;
sVariant.SetInt(m_iUnlockPoint);
pPoint->AcceptInput("SetLocked", NULL, NULL, sVariant, 0);
g_EventQueue.AddEvent(pPoint, "SetUnlockTime", sVariant, 0.1, NULL, NULL);
}
}

class CKothLogic : public CBaseEntity
{
Expand Down Expand Up @@ -1145,6 +1162,7 @@ CTFGameRules::CTFGameRules()
ListenForGameEvent( "teamplay_capture_blocked" );
ListenForGameEvent( "teamplay_round_win" );
ListenForGameEvent( "teamplay_flag_event" );
ListenForGameEvent("teamplay_point_unlocked");

Q_memset( m_vecPlayerPositions,0, sizeof(m_vecPlayerPositions) );

Expand Down Expand Up @@ -1769,7 +1787,7 @@ void CTFGameRules::SetupOnStalemateStart( void )
CArenaLogic *pArena = dynamic_cast<CArenaLogic *>( gEntList.FindEntityByClassname( NULL, "tf_logic_arena" ) );
if ( pArena )
{
pArena->m_OnArenaRoundStart.FireOutput( pArena, pArena );
//pArena->m_OnArenaRoundStart.FireOutput( pArena, pArena );

IGameEvent *event = gameeventmanager->CreateEvent( "arena_round_start" );
if ( event )
Expand All @@ -1780,6 +1798,7 @@ void CTFGameRules::SetupOnStalemateStart( void )
for ( int i = FIRST_GAME_TEAM; i < GetNumberOfTeams(); i++ )
{
BroadcastSound( i, "Announcer.AM_RoundStartRandom" );
BroadcastSound(i, "Ambient.Siren");
}

}
Expand Down Expand Up @@ -3106,10 +3125,6 @@ void CTFGameRules::PlayerKilled( CBasePlayer *pVictim, const CTakeDamageInfo &in
{
pAssister = ToTFPlayer( GetAssister( pVictim, pScorer, pInflictor ) );
}
else if ((pVictim == pScorer) && pKiller)
{
pScorer = ToTFPlayer(GetAssister(pVictim, pScorer, pInflictor));
}

//find the area the player is in and see if his death causes a block
CTriggerAreaCapture *pArea = dynamic_cast<CTriggerAreaCapture *>(gEntList.FindEntityByClassname( NULL, "trigger_capture_area" ) );
Expand Down Expand Up @@ -3384,8 +3399,8 @@ CBasePlayer *CTFGameRules::GetAssister( CBasePlayer *pVictim, CBasePlayer *pScor
if ( pTFScorer && pTFVictim )
{
// if victim killed himself, don't award an assist to anyone else, even if there was a recent damager
//if ( pTFScorer == pTFVictim )
//return NULL;
if ( pTFScorer == pTFVictim )
return NULL;

// If a player is healing the scorer, give that player credit for the assist
CTFPlayer *pHealer = ToTFPlayer( static_cast<CBaseEntity *>( pTFScorer->m_Shared.GetFirstHealer() ) );
Expand Down Expand Up @@ -4792,6 +4807,19 @@ void CTFGameRules::FireGameEvent( IGameEvent *event )
m_szMostRecentCappers[0] = iPlayerIndex;
m_szMostRecentCappers[1] = 0;
}
#endif
}
else if ( !Q_strcmp( eventName, "teamplay_point_unlocked" ) )
{
Msg("\nteamplay_point_unlocked");
#ifdef GAME_DLL
// if this is an unlock event and we're in arena, fire OnCapEnabled
CArenaLogic *pArena = dynamic_cast<CArenaLogic *>(gEntList.FindEntityByClassname(NULL, "tf_logic_arena"));
if (pArena)
{
Msg("\nFIRE CAP ENABLED");
pArena->FireOnCapEnabled();
}
#endif
}
#ifdef CLIENT_DLL
Expand Down
3 changes: 3 additions & 0 deletions src/game/shared/tf/tf_player_shared.cpp
Expand Up @@ -3388,6 +3388,9 @@ bool CTFPlayer::CanPickupBuilding(CBaseObject *pObject)
if (pObject->IsBuilding() || pObject->IsUpgrading() || pObject->IsRedeploying())
return false;

if (pObject->HasSapper())
return false;

return true;
}

Expand Down
Binary file modified src/mathlib/Debug/vc120.pdb
Binary file not shown.
Binary file modified src/tier1/Debug/vc120.pdb
Binary file not shown.
Binary file modified src/vgui2/vgui_controls/Debug/vc120.pdb
Binary file not shown.

0 comments on commit b50cef9

Please sign in to comment.