From: Lyberta Date: Tue, 10 Jul 2018 04:41:43 +0000 (+0300) Subject: Teamplay: Fixed Domination. X-Git-Tag: xonotic-v0.8.5~1953^2~3 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=3103f657858386e91bdad07c51e3826f5020ac85;p=xonotic%2Fxonotic-data.pk3dir.git Teamplay: Fixed Domination. --- 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);