diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-11-26 20:47:49 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-11-26 20:47:49 +0000 |
| commit | ddbb7e0b0ea20a115b556b99577e7de07cd703d4 (patch) | |
| tree | 2c10d2df6fc76bd4eb3288963a109cb02656eecb /src/game/server/srv_common.cpp | |
| parent | 61041e483797e02525547757f75007edceabc0f3 (diff) | |
| download | zcatch-ddbb7e0b0ea20a115b556b99577e7de07cd703d4.tar.gz zcatch-ddbb7e0b0ea20a115b556b99577e7de07cd703d4.zip | |
fixed tdm and ctf scoring
Diffstat (limited to 'src/game/server/srv_common.cpp')
| -rw-r--r-- | src/game/server/srv_common.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/game/server/srv_common.cpp b/src/game/server/srv_common.cpp index 251d1e70..417c9db7 100644 --- a/src/game/server/srv_common.cpp +++ b/src/game/server/srv_common.cpp @@ -199,4 +199,20 @@ int gameobject::getteam(int notthisid) return numplayers[0] > numplayers[1] ? 1 : 0; } +void gameobject::do_team_wincheck() +{ + if(game_over_tick == -1 && !warmup) + { + // check score win condition + if((config.scorelimit > 0 && (teamscore[0] >= config.scorelimit || teamscore[1] >= config.scorelimit)) || + (config.timelimit > 0 && (server_tick()-round_start_tick) >= config.timelimit*server_tickspeed()*60)) + { + if(teamscore[0] != teamscore[1]) + endround(); + else + sudden_death = 1; + } + } +} + gameobject *gameobj = 0; |