]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/teams.qh
Merge branch 'master' into Lyberta/StandaloneOverkillWeapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / teams.qh
index 1f8a603dd01744b1dde6a4f13f98b5b32bb61d03..57d644c0448549e13bff834f7cb6fd289d983cc3 100644 (file)
@@ -125,6 +125,42 @@ float Team_ColorToTeam(string team_color)
        return -1;
 }
 
+/// \brief Returns whether team is valid.
+/// \param[in] team_ Team to check.
+/// \return True if team is valid, false otherwise.
+bool Team_IsValidTeam(int team_)
+{
+       switch (team_)
+       {
+               case NUM_TEAM_1:
+               case NUM_TEAM_2:
+               case NUM_TEAM_3:
+               case NUM_TEAM_4:
+               {
+                       return true;
+               }
+       }
+       return false;
+}
+
+/// \brief Returns whether team number is valid.
+/// \param[in] number Team number to check.
+/// \return True if team number is valid, false otherwise.
+bool Team_IsValidNumber(int number)
+{
+       switch (number)
+       {
+               case 1:
+               case 2:
+               case 3:
+               case 4:
+               {
+                       return true;
+               }
+       }
+       return false;
+}
+
 float Team_NumberToTeam(float number)
 {
        switch(number)