about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2007-08-25 08:54:14 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2007-08-25 08:54:14 +0000
commit0e7054a24abfe2074aa5bbc556205cf2381bb87a (patch)
tree9ed115048844f1938392bcba04a36816fc83d827 /src
parent89ccbd4f7b478b49329fa39be62ee3a5b38641bc (diff)
downloadzcatch-0e7054a24abfe2074aa5bbc556205cf2381bb87a.tar.gz
zcatch-0e7054a24abfe2074aa5bbc556205cf2381bb87a.zip
made a switch for gametype
Diffstat (limited to 'src')
-rw-r--r--src/game/game_protocol.h4
-rw-r--r--src/game/game_variables.h3
-rw-r--r--src/game/server/game_server.cpp7
3 files changed, 13 insertions, 1 deletions
diff --git a/src/game/game_protocol.h b/src/game/game_protocol.h
index f04df148..cd28b2d5 100644
--- a/src/game/game_protocol.h
+++ b/src/game/game_protocol.h
@@ -47,6 +47,10 @@ enum
 	STATE_PLAYING,
 	STATE_IN_MENU,
 	STATE_CHATTING,
+	
+	GAMETYPE_DM=0,
+	GAMETYPE_TDM,
+	GAMETYPE_CTF,
 };
 
 struct player_input
diff --git a/src/game/game_variables.h b/src/game/game_variables.h
index edd3f263..c8cf0150 100644
--- a/src/game/game_variables.h
+++ b/src/game/game_variables.h
@@ -12,5 +12,8 @@ MACRO_CONFIG_INT(scroll_weapon, 1, 0, 1)
 
 MACRO_CONFIG_INT(scorelimit, 20, 0, 1000)
 MACRO_CONFIG_INT(timelimit, 0, 0, 1000)
+MACRO_CONFIG_STR(gametype, 32, "dm")
 
 MACRO_CONFIG_INT(dynamic_camera, 1, 0, 1)
+
+
diff --git a/src/game/server/game_server.cpp b/src/game/server/game_server.cpp
index 90e02978..a962f8d7 100644
--- a/src/game/server/game_server.cpp
+++ b/src/game/server/game_server.cpp
@@ -409,7 +409,12 @@ game_world world;
 gameobject::gameobject()
 : entity(OBJTYPE_GAME)
 {
-	gametype = GAMETYPE_TDM;
+	gametype = GAMETYPE_DM;
+	if(strcmp(config.gametype, "ctf") == 0)
+		gametype = GAMETYPE_CTF;
+	else if(strcmp(config.gametype, "tdm") == 0)
+		gametype = GAMETYPE_TDM;
+	
 	game_over_tick = -1;
 	sudden_death = 0;
 	round_start_tick = server_tick();