Skip to content

Commit 6cfb226

Browse files
committed
fix firing speed again, mvm fixes
1 parent facc771 commit 6cfb226

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

game/client/tf/tf_hud_tournament.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void CHudTournament::Init( void )
130130
m_flNextUpdate = gpGlobals->curtime;
131131
}
132132

133-
ConVar tf_force_mannup_sound("tf_force_mannup_sound", "0", FCVAR_DEVELOPMENTONLY);
133+
ConVar tf_force_mannup_sound("tf_force_mannup_sound", "0", FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED);
134134

135135
//-----------------------------------------------------------------------------
136136
// Purpose:

game/server/tf/player_vs_environment/tf_populators.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,7 @@ void CWave::ActiveWaveUpdate( void )
21192119
}
21202120
}
21212121

2122-
ConVar tf_force_mannup_sound("tf_force_mannup_sound", "0", FCVAR_DEVELOPMENTONLY);
2122+
ConVar tf_force_mannup_sound("tf_force_mannup_sound", "0", FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED);
21232123

21242124
//-------------------------------------------------------------------------
21252125
void CWave::WaveCompleteUpdate( void )

game/server/tf/tf_gc_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,7 @@ void CTFGCServerSystem::ClientDisconnected( CSteamID steamIDClient )
15931593
}
15941594
}
15951595

1596-
ConVar tf_sv_mvm_forced_players("tf_sv_mvm_forced_players", "0", FCVAR_REPLICATED);
1596+
extern ConVar tf_sv_mvm_forced_players;
15971597

15981598
//-----------------------------------------------------------------------------
15991599
void CTFGCServerSystem::PreClientUpdate( )

game/server/tf/tf_obj_sentrygun.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,11 +1281,11 @@ void CObjectSentrygun::Attack()
12811281
if ( m_iUpgradeLevel == 1 )
12821282
{
12831283
// Level 1 sentries fire slower
1284-
m_flNextAttack = gpGlobals->curtime + (0.2f*m_flFireRate);
1284+
m_flNextAttack += (0.2f*m_flFireRate);
12851285
}
12861286
else
12871287
{
1288-
m_flNextAttack = gpGlobals->curtime + (0.1f*m_flFireRate);
1288+
m_flNextAttack += (0.1f*m_flFireRate);
12891289
}
12901290
}
12911291
else

game/shared/basecombatweapon_shared.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2301,18 +2301,17 @@ void CBaseCombatWeapon::PrimaryAttack( void )
23012301

23022302
// To make the firing framerate independent, we may have to fire more than one bullet here on low-framerate systems,
23032303
// especially if the weapon we're firing has a really fast rate of fire.
2304-
info.m_iShots = 0;
23052304
float fireRate = GetFireRate();
23062305
int32 fireTimes = fireRate > 0.0f ? truncf((gpGlobals->curtime - m_flNextPrimaryAttack) / fireRate) + 1 : 1;
23072306

2308-
for (int32 times = 0; times < fireTimes; ++times)
2307+
for (info.m_iShots = 0; info.m_iShots < fireTimes; ++info.m_iShots)
23092308
{
23102309
// MUST call sound before removing a round from the clip of a CMachineGun
23112310
WeaponSound(SINGLE, m_flNextPrimaryAttack);
2312-
m_flNextPrimaryAttack = m_flNextPrimaryAttack + fireRate;
2313-
info.m_iShots++;
23142311
}
23152312

2313+
m_flNextPrimaryAttack += info.m_iShots * fireRate;
2314+
23162315
// Make sure we don't fire more than the amount in the clip
23172316
if ( UsesClipsForAmmo1() )
23182317
{

game/shared/tf/tf_gamerules.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20805,6 +20805,8 @@ void CTFGameRules::MatchSummaryEnd( void )
2080520805
tf_bot_quota_mode.SetValue( tf_bot_quota_mode.GetDefault() );
2080620806
}
2080720807

20808+
ConVar tf_sv_mvm_forced_players("tf_sv_mvm_forced_players", "0", FCVAR_REPLICATED);
20809+
2080820810
//-----------------------------------------------------------------------------
2080920811
// Purpose:
2081020812
//-----------------------------------------------------------------------------
@@ -20848,7 +20850,12 @@ int CTFGameRules::GetTeamAssignmentOverride( CTFPlayer *pTFPlayer, int iDesiredT
2084820850
}
2084920851

2085020852
// Bootcamp mode can mix a lobby with ad-hoc joins
20851-
int nSlotsLeft = kMVM_DefendersTeamSize - nMatchPlayers - nAdHocDefenders;
20853+
int iTeamSize = kMVM_DefendersTeamSize;
20854+
if (tf_sv_mvm_forced_players.GetInt() > iTeamSize)
20855+
{
20856+
iTeamSize = tf_sv_mvm_forced_players.GetInt();
20857+
}
20858+
int nSlotsLeft = iTeamSize - nMatchPlayers - nAdHocDefenders;
2085220859
if ( nSlotsLeft >= 1 )
2085320860
{
2085420861
Log( "MVM assigned %s to defending team (%d more slots remaining after us)\n", pTFPlayer->GetPlayerName(), nSlotsLeft-1 );

0 commit comments

Comments
 (0)