From: Lyberta Date: Fri, 9 Mar 2018 15:16:53 +0000 (+0300) Subject: Added Entity_GetTeamIndex. X-Git-Tag: xonotic-v0.8.5~1953^2~35 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c7d9d8d8d62bff4afad440eeb7ae5e9942478983;p=xonotic%2Fxonotic-data.pk3dir.git Added Entity_GetTeamIndex. --- diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 8cb78d72d..ff3abf755 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -226,6 +226,11 @@ void setcolor(entity this, int clr) #endif } +int Entity_GetTeamIndex(entity this) +{ + return Team_TeamToIndex(this.team); +} + void SetPlayerColors(entity player, float _color) { float pants = _color & 0x0F; diff --git a/qcsrc/server/teamplay.qh b/qcsrc/server/teamplay.qh index e589a176f..6ac1df288 100644 --- a/qcsrc/server/teamplay.qh +++ b/qcsrc/server/teamplay.qh @@ -40,6 +40,11 @@ string getwelcomemessage(entity this); void setcolor(entity this, int clr); +/// \brief Returns the team index of the entity. +/// \param[in] this Entity to check. +/// \return Team index of the entity. +int Entity_GetTeamIndex(entity this); + void SetPlayerColors(entity player, float _color); /// \brief Kills player as a result of team change.