File tree Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -127,9 +127,6 @@ void IGameController::DoActivityCheck()
127
127
if (g_Config.m_SvInactiveKickTime == 0 )
128
128
return ;
129
129
130
- int HumanMaxInactiveTimeSecs = Config ()->m_InfInactiveHumansKickTime ? Config ()->m_InfInactiveHumansKickTime : Config ()->m_SvInactiveKickTime * 60 ;
131
- int InfectedMaxInactiveTimeSecs = Config ()->m_InfInactiveInfectedKickTime ? Config ()->m_InfInactiveInfectedKickTime : Config ()->m_SvInactiveKickTime * 60 ;
132
-
133
130
unsigned int nbPlayers = 0 ;
134
131
135
132
for (int i = 0 ; i < MAX_CLIENTS; ++i)
@@ -166,7 +163,7 @@ void IGameController::DoActivityCheck()
166
163
if (pPlayer->IsBot ())
167
164
continue ;
168
165
169
- float PlayerMaxInactiveTimeSecs = pPlayer-> IsHuman () ? HumanMaxInactiveTimeSecs : InfectedMaxInactiveTimeSecs ;
166
+ float PlayerMaxInactiveTimeSecs = GetMaxInactiveTimeSeconds (pPlayer) ;
170
167
if (PlayerMaxInactiveTimeSecs < 20 )
171
168
{
172
169
PlayerMaxInactiveTimeSecs = 20 ;
@@ -353,6 +350,11 @@ int IGameController::GetNextClientUniqueId()
353
350
return m_NextUniqueClientId++;
354
351
}
355
352
353
+ float IGameController::GetMaxInactiveTimeSeconds (const CPlayer *pPlayer) const
354
+ {
355
+ return Config ()->m_SvInactiveKickTime * 60 ;
356
+ }
357
+
356
358
void IGameController::DoTeamChange (CPlayer *pPlayer, int Team, bool DoChatMsg)
357
359
{
358
360
Team = ClampTeam (Team);
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ class IGameController
114
114
bool IsAmmoHudEnabled () const ;
115
115
void SetAmmoHudEnabled (bool Enabled);
116
116
117
+ virtual float GetMaxInactiveTimeSeconds (const CPlayer *pPlayer) const ;
117
118
virtual void DoWincheck ();
118
119
119
120
// event
Original file line number Diff line number Diff line change @@ -5137,6 +5137,16 @@ void CInfClassGameController::CheckRoundFailed()
5137
5137
}
5138
5138
}
5139
5139
5140
+ float CInfClassGameController::GetMaxInactiveTimeSeconds (const CPlayer *pPlayer) const
5141
+ {
5142
+ const CInfClassPlayer *pInfPlayer = CInfClassPlayer::GetInstance (pPlayer);
5143
+
5144
+ int HumanMaxInactiveTimeSecs = Config ()->m_InfInactiveHumansKickTime ? Config ()->m_InfInactiveHumansKickTime : Config ()->m_SvInactiveKickTime * 60 ;
5145
+ int InfectedMaxInactiveTimeSecs = Config ()->m_InfInactiveInfectedKickTime ? Config ()->m_InfInactiveInfectedKickTime : Config ()->m_SvInactiveKickTime * 60 ;
5146
+
5147
+ return pInfPlayer->IsHuman () ? HumanMaxInactiveTimeSecs : InfectedMaxInactiveTimeSecs;
5148
+ }
5149
+
5140
5150
void CInfClassGameController::DoWincheck ()
5141
5151
{
5142
5152
if (!IsWinCheckEnabled ())
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ class CInfClassGameController : public IGameController
126
126
void OnCharacterSpawned (CInfClassCharacter *pCharacter, const SpawnContext &Context);
127
127
void OnClassChooserRequested (CInfClassCharacter *pCharacter);
128
128
void CheckRoundFailed ();
129
+ float GetMaxInactiveTimeSeconds (const CPlayer *pPlayer) const override ;
129
130
void DoWincheck () override ;
130
131
void StartRound () override ;
131
132
void ResetRoundData ();
You can’t perform that action at this time.
0 commit comments