From 3103f657858386e91bdad07c51e3826f5020ac85 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Tue, 10 Jul 2018 07:41:43 +0300 Subject: [PATCH] Teamplay: Fixed Domination. --- qcsrc/common/gamemodes/gamemode/domination/domination.qc | 5 ++++- qcsrc/server/teamplay.qh | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/gamemodes/gamemode/domination/domination.qc b/qcsrc/common/gamemodes/gamemode/domination/domination.qc index c9673da6f..0cea02f2f 100644 --- a/qcsrc/common/gamemodes/gamemode/domination/domination.qc +++ b/qcsrc/common/gamemodes/gamemode/domination/domination.qc @@ -308,8 +308,11 @@ void Domination_count_controlpoints() IL_EACH(g_dompoints, true, { ++total_control_points; + if (!Entity_HasValidTeam(it.goalentity)) + { + continue; + } entity team_ = Entity_GetTeam(it.goalentity); - //TODO: team_ seems to be NULL int num_control_points = Team_GetNumberOfControlPoints(team_); ++num_control_points; Team_SetNumberOfControlPoints(team_, num_control_points); diff --git a/qcsrc/server/teamplay.qh b/qcsrc/server/teamplay.qh index 91b9bdd8b..664a0eca4 100644 --- a/qcsrc/server/teamplay.qh +++ b/qcsrc/server/teamplay.qh @@ -71,7 +71,8 @@ int Entity_GetTeamIndex(entity this); /// \brief Returns the team entity of the given entity. /// \param[in] this Entity to check. -/// \return Team entity of the given entity. +/// \return Team entity of the given entity or NULL if the entity doesn't belong +/// to any team. entity Entity_GetTeam(entity this); void SetPlayerColors(entity player, float _color); -- 2.39.2