about summary refs log tree commit diff
path: root/src/game
diff options
context:
space:
mode:
authorTeetime <TeetimeTW@yahoo.de>2012-02-23 01:17:10 +0100
committerTeetime <TeetimeTW@yahoo.de>2012-02-23 01:17:10 +0100
commita23de27d6fee7312025d221ad5b93ecd17b2b406 (patch)
tree745dd6cb59ef01afd8b519fcbe3066dbad6d5195 /src/game
parentfca0b0816753def8d4bf16baa746a9b7c5a53723 (diff)
downloadzcatch-a23de27d6fee7312025d221ad5b93ecd17b2b406.tar.gz
zcatch-a23de27d6fee7312025d221ad5b93ecd17b2b406.zip
fixed spelling mistakes, some refractoring etc.
Diffstat (limited to 'src/game')
-rw-r--r--src/game/server/gamecontext.cpp68
-rw-r--r--src/game/server/gamecontext.h2
-rw-r--r--src/game/server/gamemodes/zcatch.cpp28
-rw-r--r--src/game/server/gamemodes/zcatch.hpp2
-rw-r--r--src/game/server/player.cpp2
-rw-r--r--src/game/server/player.h2
-rw-r--r--src/game/variables.h2
7 files changed, 52 insertions, 54 deletions
diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp
index 9e8afea8..df377ccc 100644
--- a/src/game/server/gamecontext.cpp
+++ b/src/game/server/gamecontext.cpp
@@ -544,61 +544,59 @@ void CGameContext::OnClientEnter(int ClientID)
 	m_apPlayers[ClientID]->Respawn();
 	
 	/* begin zCatch */
-	int leader_id = -1;
+	int LeaderID = -1;
 	int StartTeam = m_pController->ClampTeam(1);
 	
 	if(m_pController->IsZCatch())
 	{
-		int num = 0;
+		int Num = 0;
 		
-		for(int i=0; i<MAX_CLIENTS; i++)
+		for(int i = 0; i < MAX_CLIENTS; i++)
 		{
 			if(IsClientReady(i))
-				num++;
+				Num++;
 		}
-		if(num < 3)
+		if(Num < 3)
 			m_pController->EndRound();
 		
 		if(g_Config.m_SvAllowJoin == 1)
 		{
-			m_apPlayers[ClientID]->m_CatchedBy = ZCATCH_NOT_CATCHED;
-			m_apPlayers[ClientID]->m_SpecExplicit = (num < 3) ? 0 : 1;
-			StartTeam = (num < 3) ? m_pController->ClampTeam(1) : TEAM_SPECTATORS;
+			m_apPlayers[ClientID]->m_CaughtBy = ZCATCH_NOT_CAUGHT;
+			m_apPlayers[ClientID]->m_SpecExplicit = (Num < 3) ? 0 : 1;
+			StartTeam = (Num < 3) ? m_pController->ClampTeam(1) : TEAM_SPECTATORS;
 			SendBroadcast("You can join the game", ClientID);
-			
 		}
 		else if(g_Config.m_SvAllowJoin == 2)
 		{
-			int num2 = 0, num_prev = 0;
-			
+			int Num2 = 0, PrevNum = 0;
+
 			for(int i = 0; i < MAX_CLIENTS; i++)
 			{
 				if(m_apPlayers[i])
 				{
-					num2 = 0;
+					Num2 = 0;
 					for(int j = 0; j < MAX_CLIENTS; j++)
-		   			{
-			    			if(m_apPlayers[j] && m_apPlayers[j]->m_CatchedBy == i)
-				   			num2++;
-		    			}
-		    			if(num2 > num_prev)
-		   	 		{
-			    			leader_id = i;
-			    			num_prev = num2;
-		    			}
+						if(m_apPlayers[j] && m_apPlayers[j]->m_CaughtBy == i)
+							Num2++;
+
+					if(Num2 > PrevNum)
+					{
+						LeaderID = i;
+						PrevNum = Num2;
 		    		}
-		    	}
-		    	
-		    	if(leader_id > -1)
+				}
+		    }
+
+		    if(LeaderID > -1)
 			{
-				m_apPlayers[ClientID]->m_CatchedBy = leader_id;
+				m_apPlayers[ClientID]->m_CaughtBy = LeaderID;
 				m_apPlayers[ClientID]->m_SpecExplicit = 0;
-				m_apPlayers[ClientID]->m_SpectatorID = leader_id;
+				m_apPlayers[ClientID]->m_SpectatorID = LeaderID;
 				StartTeam = TEAM_SPECTATORS;
 			}
 			else
 			{
-				m_apPlayers[ClientID]->m_CatchedBy = ZCATCH_NOT_CATCHED;
+				m_apPlayers[ClientID]->m_CaughtBy = ZCATCH_NOT_CAUGHT;
 				m_apPlayers[ClientID]->m_SpecExplicit = 0;
 			}
 		}
@@ -625,10 +623,10 @@ void CGameContext::OnClientEnter(int ClientID)
 	    SendChatTarget(ClientID, "Welcome to zCatch!");
 	    SendChatTarget(ClientID, "type /cmdlist to get all commands");
 	    SendChatTarget(ClientID, "type /help for instructions");
-	    if(g_Config.m_SvAllowJoin == 2 && leader_id > -1)
+	    if(g_Config.m_SvAllowJoin == 2 && LeaderID > -1)
 	    {
 	    	char buf[128];
-	    	str_format(buf, sizeof(buf), "You will join the game when %s dies", Server()->ClientName(leader_id));
+	    	str_format(buf, sizeof(buf), "You will join the game when %s dies", Server()->ClientName(LeaderID));
 	    	SendChatTarget(ClientID, buf);	
 	    }
 	}
@@ -975,7 +973,7 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
 		// Switch team on given client and kill/respawn him
 		if(m_pController->CanJoinTeam(pMsg->m_Team, ClientID))
 		{
-			if(m_pController->CanChangeTeam(pPlayer, pMsg->m_Team) && !m_pController->IsZCatch()) //zCatch)
+			if(m_pController->CanChangeTeam(pPlayer, pMsg->m_Team) && !m_pController->IsZCatch()) //zCatch
 			{
 				pPlayer->m_LastSetTeam = Server()->Tick();
 				if(pPlayer->GetTeam() == TEAM_SPECTATORS || pMsg->m_Team == TEAM_SPECTATORS)
@@ -984,23 +982,23 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
 				(void)m_pController->CheckTeamBalance();
 				pPlayer->m_TeamChangeTick = Server()->Tick();
 			}
-			/* begin zCatch*/			
+			/* begin zCatch */
 			else if(m_pController->IsZCatch())
 			{	
-				if(pPlayer->m_CatchedBy >= 0)
+				if(pPlayer->m_CaughtBy >= 0)
 				{
 					char buf[256];
-					str_format(buf, sizeof(buf), "You will join automatically when \"%s\" dies.", Server()->ClientName(pPlayer->m_CatchedBy));
+					str_format(buf, sizeof(buf), "You will join automatically when \"%s\" dies.", Server()->ClientName(pPlayer->m_CaughtBy));
 					SendChatTarget(ClientID, buf);
 					return;
 				}
-				else if(pPlayer->m_CatchedBy == ZCATCH_NOT_CATCHED)
+				else if(pPlayer->m_CaughtBy == ZCATCH_NOT_CAUGHT)
 				{
 					pPlayer->m_LastSetTeam = Server()->Tick();
 					pPlayer->SetTeam(pMsg->m_Team);
 				}
 			}
-            /* end zCatch*/
+            /* end zCatch */
 			else
 				SendBroadcast("Teams must be balanced, please join other team", ClientID);
 		}
diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h
index c68c958b..d88bd13c 100644
--- a/src/game/server/gamecontext.h
+++ b/src/game/server/gamecontext.h
@@ -145,7 +145,7 @@ public:
 	
 	enum
 	{
-		ZCATCH_NOT_CATCHED = -1,
+		ZCATCH_NOT_CAUGHT = -1,
 	}; 
 	
 	struct CMutes
diff --git a/src/game/server/gamemodes/zcatch.cpp b/src/game/server/gamemodes/zcatch.cpp
index a003f741..9b364b38 100644
--- a/src/game/server/gamemodes/zcatch.cpp
+++ b/src/game/server/gamemodes/zcatch.cpp
@@ -66,7 +66,7 @@ void CGameController_zCatch::DoWincheck()
 int CGameController_zCatch::OnCharacterDeath(class CCharacter *pVictim, class CPlayer *pKiller, int WeaponID)
 {
 	int VictimID =  pVictim->GetPlayer()->GetCID();
-	char buf[256];
+	char aBuf[256];
 	if(pKiller !=  pVictim->GetPlayer())
 	{
 		pKiller->m_Kills++;
@@ -77,14 +77,14 @@ int CGameController_zCatch::OnCharacterDeath(class CCharacter *pVictim, class CP
 		/* Check if the killer is already killed and in spectator (victim may died through wallshot) */
 		if(pKiller->GetTeam() != TEAM_SPECTATORS)
 		{
-			pVictim->GetPlayer()->m_CatchedBy = pKiller->GetCID();
+			pVictim->GetPlayer()->m_CaughtBy = pKiller->GetCID();
 			pVictim->GetPlayer()->SetTeamDirect(TEAM_SPECTATORS);
 		
 			if(pVictim->GetPlayer()->m_PlayerWantToFollowCatcher)
 				pVictim->GetPlayer()->m_SpectatorID = pKiller->GetCID(); // Let the victim follow his catcher
 		
-			str_format(buf, sizeof(buf), "Caught by \"%s\". You will join the game automatically when \"%s\" dies.", Server()->ClientName(pKiller->GetCID()), Server()->ClientName(pKiller->GetCID()));	
-			GameServer()->SendChatTarget(VictimID, buf);
+			str_format(aBuf, sizeof(aBuf), "Caught by \"%s\". You will join the game automatically when \"%s\" dies.", Server()->ClientName(pKiller->GetCID()), Server()->ClientName(pKiller->GetCID()));
+			GameServer()->SendChatTarget(VictimID, aBuf);
 		}
 	}
 	else
@@ -98,9 +98,9 @@ int CGameController_zCatch::OnCharacterDeath(class CCharacter *pVictim, class CP
 	{
 		if(GameServer()->m_apPlayers[i])
 		{
-			if(GameServer()->m_apPlayers[i]->m_CatchedBy == VictimID)
+			if(GameServer()->m_apPlayers[i]->m_CaughtBy == VictimID)
 			{
-				GameServer()->m_apPlayers[i]->m_CatchedBy = ZCATCH_NOT_CATCHED;
+				GameServer()->m_apPlayers[i]->m_CaughtBy = ZCATCH_NOT_CAUGHT;
 				GameServer()->m_apPlayers[i]->SetTeamDirect(GameServer()->m_pController->ClampTeam(1));
 				
 				if(pKiller != pVictim->GetPlayer())
@@ -122,7 +122,7 @@ void CGameController_zCatch::OnPlayerInfoChange(class CPlayer *pP)
 	{
 		int Num = 161;
 		for(int i = 0; i < MAX_CLIENTS; i++)
-			if(GameServer()->m_apPlayers[i] && GameServer()->m_apPlayers[i]->m_CatchedBy == pP->GetCID())
+			if(GameServer()->m_apPlayers[i] && GameServer()->m_apPlayers[i]->m_CaughtBy == pP->GetCID())
 				Num -= 10;
 		pP->m_TeeInfos.m_ColorBody = Num * 0x010000 + 0xff00;
 		pP->m_TeeInfos.m_ColorFeet = Num * 0x010000 + 0xff00;
@@ -146,7 +146,7 @@ void CGameController_zCatch::StartRound()
 	{
 		if(GameServer()->m_apPlayers[i])
 		{		
-			GameServer()->m_apPlayers[i]->m_CatchedBy = ZCATCH_NOT_CATCHED;
+			GameServer()->m_apPlayers[i]->m_CaughtBy = ZCATCH_NOT_CAUGHT;
 			GameServer()->m_apPlayers[i]->m_Kills = 0;
 			GameServer()->m_apPlayers[i]->m_Deaths = 0;
 			GameServer()->m_apPlayers[i]->m_TicksSpec = 0;
@@ -204,17 +204,17 @@ void CGameController_zCatch::EndRound()
 			{
 				GameServer()->m_apPlayers[i]->SetTeamDirect(GameServer()->m_pController->ClampTeam(1));
 				
-				char abuf[128];
-				str_format(abuf, sizeof(abuf), "Kills: %d | Deaths: %d", GameServer()->m_apPlayers[i]->m_Kills, GameServer()->m_apPlayers[i]->m_Deaths);				
-				GameServer()->SendChatTarget(i, abuf);
+				char aBuf[128];
+				str_format(aBuf, sizeof(aBuf), "Kills: %d | Deaths: %d", GameServer()->m_apPlayers[i]->m_Kills, GameServer()->m_apPlayers[i]->m_Deaths);
+				GameServer()->SendChatTarget(i, aBuf);
 				
 				if(GameServer()->m_apPlayers[i]->m_TicksSpec != 0 || GameServer()->m_apPlayers[i]->m_TicksIngame != 0)
 				{
 					double TimeInSpec = (GameServer()->m_apPlayers[i]->m_TicksSpec*100.0) / (GameServer()->m_apPlayers[i]->m_TicksIngame + GameServer()->m_apPlayers[i]->m_TicksSpec);
-					str_format(abuf, sizeof(abuf), "Spec: %.2f%% | Ingame: %.2f%%", (double)TimeInSpec, (double)(100.0 - TimeInSpec));
-					GameServer()->SendChatTarget(i, abuf);	
+					str_format(aBuf, sizeof(aBuf), "Spec: %.2f%% | Ingame: %.2f%%", (double)TimeInSpec, (double)(100.0 - TimeInSpec));
+					GameServer()->SendChatTarget(i, aBuf);
 				}
-				GameServer()->m_apPlayers[i]->m_CatchedBy = ZCATCH_NOT_CATCHED; //Set all players in server as non-catched
+				GameServer()->m_apPlayers[i]->m_CaughtBy = ZCATCH_NOT_CAUGHT; //Set all players in server as non-caught
 			}
 		}
 	}
diff --git a/src/game/server/gamemodes/zcatch.hpp b/src/game/server/gamemodes/zcatch.hpp
index 58e43f61..d4e33bd1 100644
--- a/src/game/server/gamemodes/zcatch.hpp
+++ b/src/game/server/gamemodes/zcatch.hpp
@@ -20,7 +20,7 @@ class CGameController_zCatch : public IGameController
 	
 	enum
 	{
-		ZCATCH_NOT_CATCHED = -1,
+		ZCATCH_NOT_CAUGHT = -1,
 	}; 
 	
 	virtual int OnCharacterDeath(class CCharacter *pVictim, class CPlayer *pKiller, int WeaponID);
diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp
index 09518a78..7110d229 100644
--- a/src/game/server/player.cpp
+++ b/src/game/server/player.cpp
@@ -23,7 +23,7 @@ CPlayer::CPlayer(CGameContext *pGameServer, int ClientID, int Team)
 	m_TeamChangeTick = Server()->Tick();
 	
 	//zCatch
-	m_CatchedBy = -1;
+	m_CaughtBy = -1;
 	m_SpecExplicit = 0;
 	m_Kills = 0;
 	m_Deaths = 0;
diff --git a/src/game/server/player.h b/src/game/server/player.h
index 92e2ccc8..6bd39370 100644
--- a/src/game/server/player.h
+++ b/src/game/server/player.h
@@ -98,7 +98,7 @@ public:
 	} m_Latency;
 	
 		//zCatch:
-	int m_CatchedBy;
+	int m_CaughtBy;
 	int m_SpecExplicit;
 	int m_Deaths;
 	int m_Kills;
diff --git a/src/game/variables.h b/src/game/variables.h
index 4b321a36..b0daf185 100644
--- a/src/game/variables.h
+++ b/src/game/variables.h
@@ -95,7 +95,7 @@ MACRO_CONFIG_INT(DbgTuning, dbg_tuning, 0, 0, 1, CFGFLAG_CLIENT, "")
 MACRO_CONFIG_INT(SvMode, sv_mode, 1, 1, 5, CFGFLAG_SERVER, "1 - Instagib; 2 - Rocket area; 3 - Hammerparty; 4 - Grenade; 5 - Ninja")
 MACRO_CONFIG_INT(SvAllowJoin, sv_allow_join, 2, 1, 2, CFGFLAG_SERVER, "Allow new Players to join without waiting for the next round")
 //1 = Allowed to join; 2 = Will join when person with the most kills die
-MACRO_CONFIG_INT(SvColorIndicator, sv_color_indicator, 1, 0, 1, CFGFLAG_SERVER, "Color tees apropriate to the number of currently catched players")
+MACRO_CONFIG_INT(SvColorIndicator, sv_color_indicator, 1, 0, 1, CFGFLAG_SERVER, "Color tees apropriate to the number of currently caught players")
 MACRO_CONFIG_INT(SvBonus, sv_bonus, 0, 0, 10000, CFGFLAG_SERVER, "Give the last player extra points")
 MACRO_CONFIG_INT(SvFollowCatcher, sv_follow_catcher, 1, 0, 1, CFGFLAG_SERVER, "If a victim should follow his catcher")
 MACRO_CONFIG_INT(SvLaserjumps, sv_laserjumps, 0, 0, 1, CFGFLAG_SERVER, "Use laserjumps - on a laser bounce a explosion will occur which takes no damage")