#include "sv_domination.qh"
+#include <server/client.qh>
+#include <server/command/vote.qh>
+#include <server/damage.qh>
+#include <server/gamelog.qh>
+#include <server/items/items.qh>
#include <server/teamplay.qh>
+#include <server/world.qh>
+#include <common/mapobjects/platforms.qh>
+#include <common/mapobjects/triggers.qh>
bool g_domination;
});
}
-int Domination_GetWinnerTeam()
-{
- int winner_team = 0;
- if (Team_GetNumberOfControlPoints(Team_GetTeamFromIndex(1)) ==
- total_control_points)
- {
- winner_team = NUM_TEAM_1;
- }
- for (int i = 2; i <= NUM_TEAMS; ++i)
- {
- if (Team_GetNumberOfControlPoints(Team_GetTeamFromIndex(i)) ==
- total_control_points)
- {
- if (winner_team != 0)
- {
- return 0;
- }
- winner_team = Team_IndexToTeam(i);
- }
- }
- if (winner_team)
- {
- return winner_team;
- }
- return -1; // no control points left?
-}
-
bool Domination_CheckWinner()
{
if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0)
}
Domination_count_controlpoints();
-
- float winner_team = Domination_GetWinnerTeam();
-
- if(winner_team == -1)
- return false;
+ int winner_team = Team_GetWinnerTeam_WIthControlPoints(total_control_points);
+ if (winner_team == -1)
+ return 0;
if(winner_team > 0)
{
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
TeamScore_AddToTeam(winner_team, ST_DOM_CAPS, +1);
}
- else if(winner_team == -1)
- {
- Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_TIED);
- Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_TIED);
- }
game_stopped = true;
round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit);
precache_sound(this.noise);
if (this.noise1 != "")
precache_sound(this.noise1);
- this.classname = "dom_team";
_setmodel(this, this.model); // precision not needed
this.mdl = this.model;
this.dmg = this.modelindex;
void dom_spawnpoint(vector org)
{
entity e = spawn();
- e.classname = "dom_controlpoint";
setthink(e, spawnfunc_dom_controlpoint);
e.nextthink = time;
setorigin(e, org);
void dom_Initialize()
{
g_domination = true;
+ g_dompoints = IL_NEW();
+
InitializeEntity(NULL, dom_DelayedInit, INITPRIO_GAMETYPE);
}