MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / autoTime

Function autoTime

plugins/koth/koth.cpp:325–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325void autoTime() {
326 int numPlayers =
327 bz_getTeamCount(eRedTeam) + bz_getTeamCount(eGreenTeam) + bz_getTeamCount(eBlueTeam) + bz_getTeamCount(ePurpleTeam) +
328 bz_getTeamCount(eRogueTeam);
329
330 if (!koth.autoTimeOn || numPlayers < 3) {
331 koth.adjustedTime = koth.TTH;
332 return;
333 }
334
335 double timeDown = (1 - ((double) numPlayers - 2) * koth.timeMult);
336
337 if (timeDown < koth.timeMultMin) {
338 timeDown = koth.timeMultMin;
339 }
340
341 koth.adjustedTime = (int)(koth.TTH * timeDown);
342
343 return;
344}
345
346double ConvertToNum(std::string inmessage, double minNum, double maxNum) {
347

Callers 2

processMethod · 0.70
handleMethod · 0.70

Calls 1

bz_getTeamCountFunction · 0.85

Tested by

no test coverage detected