From 0e7054a24abfe2074aa5bbc556205cf2381bb87a Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sat, 25 Aug 2007 08:54:14 +0000 Subject: [PATCH] made a switch for gametype --- datasrc/teewars.ds | 11 ----------- src/game/game_protocol.h | 4 ++++ src/game/game_variables.h | 3 +++ src/game/server/game_server.cpp | 7 ++++++- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/datasrc/teewars.ds b/datasrc/teewars.ds index 94c23083e..a2e1afaa2 100644 --- a/datasrc/teewars.ds +++ b/datasrc/teewars.ds @@ -305,17 +305,6 @@ powerups { } } -playerstats { - dm { - maxhealth 10 - maxarmor 10 - } - tdm { - maxhealth 10 - maxarmor 10 - } -} - projectileparticles { gun { particlespersecond 200 diff --git a/src/game/game_protocol.h b/src/game/game_protocol.h index f04df1483..cd28b2d5c 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 edd3f263c..c8cf01508 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 90e029783..a962f8d74 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();