about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-29 21:46:38 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-29 21:46:38 +0000
commitfd0f68a12ce4689ed848f4e6ac22f23bef556676 (patch)
tree538e0bf6beb417d6c43fc59dcc5e723c1065d7a1
parente822830056e8e6bdefdf2e77db819c9ac67311f4 (diff)
downloadzcatch-fd0f68a12ce4689ed848f4e6ac22f23bef556676.tar.gz
zcatch-fd0f68a12ce4689ed848f4e6ac22f23bef556676.zip
some clean up and added sv_rounds_per_map variable
-rw-r--r--src/game/g_variables.h1
-rw-r--r--src/game/server/gs_game.cpp3
-rw-r--r--src/game/server/gs_server.cpp37
3 files changed, 4 insertions, 37 deletions
diff --git a/src/game/g_variables.h b/src/game/g_variables.h
index e95b1e4e..c08bd10d 100644
--- a/src/game/g_variables.h
+++ b/src/game/g_variables.h
@@ -47,6 +47,7 @@ MACRO_CONFIG_INT(sv_warmup, 0, 0, 0)
 MACRO_CONFIG_STR(sv_motd, 900, "")
 MACRO_CONFIG_INT(sv_teamdamage, 0, 0, 1)
 MACRO_CONFIG_STR(sv_maprotation, 512, "")
+MACRO_CONFIG_INT(sv_rounds_per_map, 1, 1, 100)
 MACRO_CONFIG_INT(sv_powerups, 1, 0, 1)
 MACRO_CONFIG_INT(sv_scorelimit, 20, 0, 1000)
 MACRO_CONFIG_INT(sv_timelimit, 0, 0, 1000)
diff --git a/src/game/server/gs_game.cpp b/src/game/server/gs_game.cpp
index c94a1417..1f5456c3 100644
--- a/src/game/server/gs_game.cpp
+++ b/src/game/server/gs_game.cpp
@@ -121,6 +121,9 @@ void gameobject::cyclemap()
 	if(!strlen(config.sv_maprotation))
 		return;
 
+	if(round_count < config.sv_rounds_per_map-1)
+		return;
+		
 	// handle maprotation
 	const char *map_rotation = config.sv_maprotation;
 	const char *current_map = config.sv_map;
diff --git a/src/game/server/gs_server.cpp b/src/game/server/gs_server.cpp
index e31b8c80..22962470 100644
--- a/src/game/server/gs_server.cpp
+++ b/src/game/server/gs_server.cpp
@@ -1989,35 +1989,6 @@ player *closest_player(vec2 pos, float radius, entity *notthis)
 	return closest;
 }
 
-
-// TODO: should be more general
-
-	/*
-player* intersect_player(vec2 pos0, vec2 pos1, vec2& new_pos, entity* notthis)
-{
-	// Find other players
-	
-	
-	entity *ents[64];
-	vec2 dir = pos1 - pos0;
-	float radius = length(dir * 0.5f);
-	vec2 center = pos0 + dir * 0.5f;
-	const int types[] = {OBJTYPE_PLAYER_CHARACTER};
-	int num = world->find_entities(center, radius, ents, 64, types, 1);
-	for (int i = 0; i < num; i++)
-	{
-		// Check if entity is a player
-		if (ents[i] != notthis)
-		{
-			new_pos = ents[i]->pos;
-			return (player*)ents[i];
-		}
-	}
-
-	return 0;
-}
-*/
-
 // Server hooks
 void mods_tick()
 {
@@ -2083,20 +2054,12 @@ void mods_connected(int client_id)
 {
 	players[client_id].init();
 	players[client_id].client_id = client_id;
-
-	//dbg_msg("game", "connected player='%d:%s'", client_id, server_clientname(client_id));
-
 	
 	// Check which team the player should be on
 	if(config.sv_tournament_mode)
 		players[client_id].team = -1;
 	else
-	{
-		/*if(gameobj->gametype == GAMETYPE_DM)
-			players[client_id].team = 0;
-		else*/
 		players[client_id].team = gameobj->get_auto_team(client_id);
-	}
 
 	// send motd
 	NETMSG_SV_MOTD msg;