2007-11-25 19:42:40 +00:00
|
|
|
/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
|
2007-12-15 10:24:49 +00:00
|
|
|
#include <engine/e_config.h>
|
2008-06-12 12:09:34 +00:00
|
|
|
#include "gs_common.hpp"
|
|
|
|
#include "gs_game_tdm.hpp"
|
2007-09-25 23:03:15 +00:00
|
|
|
|
2008-06-12 10:51:48 +00:00
|
|
|
GAMECONTROLLER_TDM::GAMECONTROLLER_TDM()
|
2007-11-04 00:19:41 +00:00
|
|
|
{
|
|
|
|
is_teamplay = true;
|
|
|
|
}
|
|
|
|
|
2008-06-12 10:51:48 +00:00
|
|
|
int GAMECONTROLLER_TDM::on_player_death(class PLAYER *victim, class PLAYER *killer, int weapon)
|
2007-11-26 19:18:49 +00:00
|
|
|
{
|
2008-06-12 10:51:48 +00:00
|
|
|
GAMECONTROLLER::on_player_death(victim, killer, weapon);
|
2007-11-26 19:18:49 +00:00
|
|
|
|
|
|
|
if(weapon >= 0)
|
|
|
|
{
|
|
|
|
// do team scoring
|
|
|
|
if(killer == victim)
|
|
|
|
teamscore[killer->team&1]--; // klant arschel
|
|
|
|
else
|
|
|
|
teamscore[killer->team&1]++; // good shit
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-06-12 10:51:48 +00:00
|
|
|
void GAMECONTROLLER_TDM::tick()
|
2007-09-25 23:03:15 +00:00
|
|
|
{
|
2008-01-17 23:09:49 +00:00
|
|
|
do_team_score_wincheck();
|
2008-06-12 10:51:48 +00:00
|
|
|
GAMECONTROLLER::tick();
|
2007-09-25 23:03:15 +00:00
|
|
|
}
|