about summary refs log tree commit diff
path: root/src/engine/client
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-08-27 15:48:50 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-08-27 15:48:50 +0000
commitdfe499248f1b1236487156b28e4a535d7963fe35 (patch)
treea750b0f28cfd3f3e252602681412ac1adc6d29c7 /src/engine/client
parentd711dd190cac809a9bd278fba03ed974812bb863 (diff)
downloadzcatch-dfe499248f1b1236487156b28e4a535d7963fe35.tar.gz
zcatch-dfe499248f1b1236487156b28e4a535d7963fe35.zip
major commit. game client restructure. not complete, loads of stuff not working, but the structure is there
Diffstat (limited to 'src/engine/client')
-rw-r--r--src/engine/client/ec_client.c4
-rw-r--r--src/engine/client/ec_srvbrowse.c9
2 files changed, 7 insertions, 6 deletions
diff --git a/src/engine/client/ec_client.c b/src/engine/client/ec_client.c
index 268e82b0..409534d1 100644
--- a/src/engine/client/ec_client.c
+++ b/src/engine/client/ec_client.c
@@ -265,6 +265,8 @@ void *snap_find_item(int snapid, int type, int id)
 int snap_num_items(int snapid)
 {
 	dbg_assert(snapid >= 0 && snapid < NUM_SNAPSHOT_TYPES, "invalid snapid");
+	if(!snapshots[snapid])
+		return 0;
 	return snapshots[snapid]->snap->num_items;
 }
 
@@ -767,7 +769,7 @@ static void client_process_packet(NETCHUNK *packet)
 				str_copy(info.version, unpacker_get_string(&up), sizeof(info.version));
 				str_copy(info.name, unpacker_get_string(&up), sizeof(info.name));
 				str_copy(info.map, unpacker_get_string(&up), sizeof(info.map));
-				info.game_type = atol(unpacker_get_string(&up));
+				str_copy(info.gametype, unpacker_get_string(&up), sizeof(info.gametype));
 				info.flags = atol(unpacker_get_string(&up));
 				info.progression = atol(unpacker_get_string(&up));
 				info.num_players = atol(unpacker_get_string(&up));
diff --git a/src/engine/client/ec_srvbrowse.c b/src/engine/client/ec_srvbrowse.c
index 07e2d227..0cf6b59d 100644
--- a/src/engine/client/ec_srvbrowse.c
+++ b/src/engine/client/ec_srvbrowse.c
@@ -104,9 +104,7 @@ static int client_serverbrowse_sort_compare_gametype(const void *ai, const void
 {
 	SERVERENTRY *a = serverlist[*(const int*)ai];
 	SERVERENTRY *b = serverlist[*(const int*)bi];
-	if(a->info.game_type > b->info.game_type) return 1;
-	if(a->info.game_type < b->info.game_type) return -1;
-	return 0;
+	return strcmp(a->info.gametype, b->info.gametype);
 }
 
 static int client_serverbrowse_sort_compare_progression(const void *ai, const void *bi)
@@ -154,8 +152,9 @@ static void client_serverbrowse_filter()
 			filtered = 1;
 		else if(config.b_filter_ping < serverlist[i]->info.latency)
 			filtered = 1;
-		else if(!(config.b_filter_gametype&(1<<serverlist[i]->info.game_type)))
-			filtered = 1;
+		/* TODO: repair me
+		else if(!(config.b_filter_gametype&(1 << serverlist[i]->info.game_type)))
+			filtered = 1;*/
 		else if(config.b_filter_compatversion && strncmp(serverlist[i]->info.version, modc_net_version(), 3) != 0)
 			filtered = 1;
 		else if(config.b_filter_string[0] != 0)