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

Function DMFCInputCommand_MinCount

netgames/hoard/hoard.cpp:237–265  ·  view source on GitHub ↗

bool StringParseWord(const char *string,char *word,int size,const char **newpos) { *newpos = string; word[0] = '\0'; //get through all the whitespace while( *string && *string==' ') string++; if(!(*string)){ //nothing is left in the string *newpos = string; return false; } //we're at the begin

Source from the content-addressed store, hash-verified

235}
236*/
237void DMFCInputCommand_MinCount(const char *input_string) {
238 if (DMFCBase->GetLocalRole() != LR_SERVER)
239 return;
240 if (!DMFCBase->IAmDedicatedServer())
241 return;
242
243 char s[20];
244
245 // parse "$mincount"
246 if (!StringParseWord(input_string, s, 20, &input_string)) {
247 DMFCBase->DisplayInputCommandHelp("mincount");
248 return;
249 }
250
251 // parse count
252 int count;
253 if (!StringParseNumber(input_string, &count, &input_string)) {
254 DMFCBase->DisplayInputCommandHelp("mincount");
255 return;
256 }
257
258 if (count < 1)
259 count = 1;
260 if (count > 12)
261 count = 12;
262
263 config.min_hoard = count;
264 DLLAddHUDMessage("Hoard Orb Score Minimum Count Set To %d", count);
265}
266
267// Initializes the game function pointers
268void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use) {

Callers

nothing calls this directly

Calls 5

StringParseWordFunction · 0.85
StringParseNumberFunction · 0.85
GetLocalRoleMethod · 0.80
IAmDedicatedServerMethod · 0.80

Tested by

no test coverage detected