about summary refs log tree commit diff
path: root/src/game/server/gs_game_tdm.cpp
blob: d865a65abc4c62f58f82144d411a82776056a234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
#include <engine/e_config.h>
#include "gs_common.hpp"
#include "gs_game_tdm.hpp"

GAMECONTROLLER_TDM::GAMECONTROLLER_TDM()
{
	is_teamplay = true;
}

int GAMECONTROLLER_TDM::on_character_death(class CHARACTER *victim, class PLAYER *killer, int weapon)
{
	GAMECONTROLLER::on_character_death(victim, killer, weapon);
	
	if(weapon >= 0)
	{
		// do team scoring
		if(killer == victim->player)
			teamscore[killer->team&1]--; // klant arschel
		else
			teamscore[killer->team&1]++; // good shit
	}
	return 0;
}

void GAMECONTROLLER_TDM::tick()
{
	do_team_score_wincheck();
	GAMECONTROLLER::tick();
}