Skip to content
Permalink
Browse files

/pause <name> always switches to watching name

Old behaviour switched you out of pause if you were paused already
Thanks to fokkonaut for suggestion
  • Loading branch information
def- committed Dec 23, 2017
1 parent 08d7fc1 commit 627291c510c935b1b16dd31e6f2e37f9298d4e9e
Showing with 20 additions and 8 deletions.
  1. +20 −8 src/game/server/ddracechat.cpp
@@ -286,10 +286,19 @@ void CGameContext::ConToggleSpec(IConsole::IResult *pResult, void *pUserData)
int PauseState = pPlayer->IsPaused();
if(PauseState <= 0)
{
if(-PauseState != CPlayer::PAUSE_SPEC)
if(pResult->NumArguments() > 0)
{
pPlayer->Pause(CPlayer::PAUSE_SPEC, false);
pPlayer->SpectatePlayerName(pResult->GetString(0));
}
else if(-PauseState == CPlayer::PAUSE_SPEC)
{
pPlayer->Pause(CPlayer::PAUSE_NONE, false);
}
else if(-PauseState != CPlayer::PAUSE_SPEC)
{
pPlayer->Pause(CPlayer::PAUSE_SPEC, false);
}
}
else
{
@@ -298,9 +307,6 @@ void CGameContext::ConToggleSpec(IConsole::IResult *pResult, void *pUserData)
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "spec", aBuf);
return;
}

if(pResult->NumArguments() > 0)
pPlayer->SpectatePlayerName(pResult->GetString(0));
}

void CGameContext::ConTogglePause(IConsole::IResult *pResult, void *pUserData)
@@ -317,10 +323,19 @@ void CGameContext::ConTogglePause(IConsole::IResult *pResult, void *pUserData)
int PauseState = pPlayer->IsPaused();
if(PauseState <= 0)
{
if(-PauseState != CPlayer::PAUSE_PAUSED)
if(pResult->NumArguments() > 0)
{
pPlayer->Pause(CPlayer::PAUSE_PAUSED, false);
pPlayer->SpectatePlayerName(pResult->GetString(0));
}
else if(-PauseState == CPlayer::PAUSE_PAUSED)
{
pPlayer->Pause(CPlayer::PAUSE_NONE, false);
}
else if(-PauseState != CPlayer::PAUSE_PAUSED)
{
pPlayer->Pause(CPlayer::PAUSE_PAUSED, false);
}
}
else
{
@@ -329,9 +344,6 @@ void CGameContext::ConTogglePause(IConsole::IResult *pResult, void *pUserData)
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "spec", aBuf);
return;
}

if(pResult->NumArguments() > 0)
pPlayer->SpectatePlayerName(pResult->GetString(0));
}

void CGameContext::ConTeamTop5(IConsole::IResult *pResult, void *pUserData)

1 comment on commit 627291c

@worstwish

This comment has been minimized.

Copy link

@worstwish worstwish commented on 627291c Dec 28, 2017

-1

Please sign in to comment.
You can’t perform that action at this time.