From bdcb063dcffd1bc054442975d772a785a7ea13c5 Mon Sep 17 00:00:00 2001 From: "Marius \"Teelevision\" Neugebauer" Date: Thu, 14 Aug 2014 02:55:20 +0200 Subject: limited scoring and releasing message now shows who is next --- src/game/server/gamecontext.cpp | 6 ++++-- src/game/server/gamemodes/zcatch.cpp | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/game/server') diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index a9397d1a..52b5b9fd 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1362,8 +1362,10 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID) { int lastVictim = pPlayer->LastZCatchVictim(); pPlayer->ReleaseZCatchVictim(CPlayer::ZCATCH_RELEASE_ALL, 1); - char aBuf[128]; - str_format(aBuf, sizeof(aBuf), "You released '%s'. (%d left)", Server()->ClientName(lastVictim), pPlayer->m_zCatchNumVictims); + int nextToRelease = pPlayer->LastZCatchVictim(); + char aBuf[128], bBuf[128]; + str_format(bBuf, sizeof(bBuf), ", next: %s", Server()->ClientName(nextToRelease)); + str_format(aBuf, sizeof(aBuf), "You released '%s'. (%d left%s)", Server()->ClientName(lastVictim), pPlayer->m_zCatchNumVictims, pPlayer->m_zCatchNumVictims > 0 ? bBuf : ""); SendChatTarget(ClientID, aBuf); str_format(aBuf, sizeof(aBuf), "You were released by '%s'.", Server()->ClientName(ClientID)); SendChatTarget(lastVictim, aBuf); diff --git a/src/game/server/gamemodes/zcatch.cpp b/src/game/server/gamemodes/zcatch.cpp index 3dbec457..63ed3dfb 100644 --- a/src/game/server/gamemodes/zcatch.cpp +++ b/src/game/server/gamemodes/zcatch.cpp @@ -80,7 +80,13 @@ int CGameController_zCatch::OnCharacterDeath(class CCharacter *pVictim, class CP CPlayer *victim = pVictim->GetPlayer(); if(pKiller != victim) { - pKiller->m_Score += victim->m_zCatchNumKillsInARow + 1; + /* count players playing */ + int numPlayers = 0; + for(int i = 0; i < MAX_CLIENTS; i++) + if(GameServer()->m_apPlayers[i] && !GameServer()->m_apPlayers[i]->m_SpecExplicit) + ++numPlayers; + /* you can at max get that many points as there are players playing */ + pKiller->m_Score += min(victim->m_zCatchNumKillsInARow + 1, numPlayers); ++pKiller->m_Kills; ++victim->m_Deaths; /* Check if the killer is already killed and in spectator (victim may died through wallshot) */ -- cgit 1.4.1