Skip to content

Commit

Permalink
goto spectator considered less harmful
Browse files Browse the repository at this point in the history
  • Loading branch information
flowtron committed Mar 23, 2022
1 parent cfe6251 commit 1ece5af
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions source/src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2113,18 +2113,12 @@ bool updateclientteam(int cln, int newteam, int ftr)
if (team_isspect(newteam)) {
cl.state.state = CS_SPECTATE;
cl.state.lastdeath = sg->gamemillis;
if(!m_coop) // punishment – compare suicide code in serverdamage()
if(m_flags_ && clienthasflag(cl.clientnum) >= 0) // switching to spectate while holding the flag punishment
{
mlog(ACLOG_INFO, "[%s] %s switched to specators during a match.", cl.hostname, cl.name);
cl.state.frags--;
cl.state.teamkills++;
cl.incrementvitacounter(VS_TKS, 1);
sendf(-1, 1, "ri5", SV_DIED, -1, cl.clientnum, cl.state.frags, -1); // victim:-1 => no dokill() on client side, gun is irrelevant too
if( (m_htf || m_ktf) && clienthasflag(cl.clientnum) >= 0 )
{
cl.state.antiflags++;
cl.incrementvitacounter(VS_ANTIFLAGS, 1);
if(m_htf || m_ktf){
cl.state.flagscore--;
cl.state.antiflags++;
cl.incrementvitacounter(VS_ANTIFLAGS, 1);
sendf(-1, 1, "riii", SV_FLAGCNT, cl.clientnum, cl.state.flagscore);
}
}
Expand Down

0 comments on commit 1ece5af

Please sign in to comment.