MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / GetDLLNumTeamInfo

Function GetDLLNumTeamInfo

Descent3/Game2DLL.cpp:817–839  ·  view source on GitHub ↗

Call this function to get information about the number of teams for the game Returns true if it's a team game...false if it's a non-team game. If it returns true, then min is filled in with the minumum number of teams needed for the game and max is filled in with the maximum number of teams for the game...if they are the same value, then it is the only number of teams supported.

Source from the content-addressed store, hash-verified

815// and max is filled in with the maximum number of teams for the game...if they are the same
816// value, then it is the only number of teams supported.
817bool GetDLLNumTeamInfo(const char *name, int *mint, int *maxt) {
818 tDLLOptions dllo;
819 if (!GetDLLGameInfo(name, &dllo)) {
820 *mint = 1;
821 *maxt = 1;
822 return false;
823 }
824 if (!(dllo.flags & DOF_MAXTEAMS)) {
825 *mint = 1;
826 *maxt = 1;
827 return false;
828 }
829 *maxt = (dllo.max_teams == 0 || dllo.max_teams == 1 || dllo.max_teams < 0) ? 1 : std::min(dllo.max_teams, 4);
830 if ((*maxt) == 1) {
831 *mint = 1;
832 } else {
833 *mint = 2;
834 }
835 if (dllo.flags & DOF_MINTEAMS && dllo.min_teams >= 0) {
836 *mint = (dllo.min_teams == 0 || dllo.min_teams == 1) ? 1 : std::min(*maxt, dllo.min_teams);
837 }
838 return ((*maxt) == 1) ? false : true;
839}

Callers 2

CheckMissionForScriptFunction · 0.85
LoadGameDLLFunction · 0.85

Calls 1

GetDLLGameInfoFunction · 0.85

Tested by

no test coverage detected