about summary refs log tree commit diff
path: root/src/game/server
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2007-11-18 14:49:56 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2007-11-18 14:49:56 +0000
commit65c7ab0a40497887fe38b5c1c49034ecd2a40c81 (patch)
tree0192f84de97e9f14b11ec4a74a889460bf1343bc /src/game/server
parentd4d1691fea007b04ad21686e8622efbbe53e9768 (diff)
downloadzcatch-65c7ab0a40497887fe38b5c1c49034ecd2a40c81.tar.gz
zcatch-65c7ab0a40497887fe38b5c1c49034ecd2a40c81.zip
fixed the spectate, join team buttons
Diffstat (limited to 'src/game/server')
-rw-r--r--src/game/server/game_server.cpp33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/game/server/game_server.cpp b/src/game/server/game_server.cpp
index 9a02a95d..241e3862 100644
--- a/src/game/server/game_server.cpp
+++ b/src/game/server/game_server.cpp
@@ -1590,6 +1590,14 @@ void mods_message(int msg, int client_id)
 	{
 		// Switch team on given client and kill/respawn him
 		players[client_id].set_team(msg_unpack_int());
+		gameobj->on_player_info_change(&players[client_id]);
+		
+		// send all info to this client
+		for(int i = 0; i < MAX_CLIENTS; i++)
+		{
+			if(players[i].client_id != -1)
+				send_info(i, -1);
+		}		
 	}
 	else if (msg == MSG_CHANGEINFO || msg == MSG_STARTINFO)
 	{
@@ -1735,25 +1743,14 @@ void mods_init()
 
 	if(config.dbg_bots)
 	{
-		/*
-		static int count = 0;
-		if(count >= 0)
+
+		for(int i = 0; i < config.dbg_bots ; i++)
 		{
-			count++;
-			if(count == 10)
-			{*/
-				for(int i = 0; i < config.dbg_bots ; i++)
-				{
-					mods_connected(MAX_CLIENTS-i-1);
-					mods_client_enter(MAX_CLIENTS-i-1);
-					//strcpy(players[MAX_CLIENTS-i-1].name, "(bot)");
-					if(gameobj->gametype != GAMETYPE_DM)
-						players[MAX_CLIENTS-i-1].team = i&1;
-				}
-				/*
-				count = -1;
-			}
-		}*/
+			mods_connected(MAX_CLIENTS-i-1);
+			mods_client_enter(MAX_CLIENTS-i-1);
+			if(gameobj->gametype != GAMETYPE_DM)
+				players[MAX_CLIENTS-i-1].team = i&1;
+		}
 	}
 }