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
| 235 | } |
| 236 | */ |
| 237 | void 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 |
| 268 | void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use) { |
nothing calls this directly
no test coverage detected