about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMarius "Teelevision" Neugebauer <marius@teele.eu>2014-08-14 02:55:20 +0200
committerMarius "Teelevision" Neugebauer <marius@teele.eu>2014-08-14 02:55:20 +0200
commitbdcb063dcffd1bc054442975d772a785a7ea13c5 (patch)
tree814c6536f142528d637598f371810394447baf9a /src
parent53d9302d597f2e6fc58ba83640caae6f8eb2f49e (diff)
downloadzcatch-bdcb063dcffd1bc054442975d772a785a7ea13c5.tar.gz
zcatch-bdcb063dcffd1bc054442975d772a785a7ea13c5.zip
limited scoring and releasing message now shows who is next
Diffstat (limited to 'src')
-rw-r--r--src/game/server/gamecontext.cpp6
-rw-r--r--src/game/server/gamemodes/zcatch.cpp8
2 files changed, 11 insertions, 3 deletions
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) */