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

Function onePlayer

plugins/koth/koth.cpp:302–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302bool onePlayer() {
303 int numPlayers =
304 bz_getTeamCount(eRedTeam) + bz_getTeamCount(eGreenTeam) + bz_getTeamCount(eBlueTeam) + bz_getTeamCount(ePurpleTeam) +
305 bz_getTeamCount(eRogueTeam);
306
307 if (numPlayers <= 1) {
308 if (!koth.onePlayerWarn) {
309 bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS, "King of the Hill disabled: less than 2 players.");
310 }
311
312 koth.onePlayerWarn = true;
313 return true;
314 }
315 else {
316 if (koth.onePlayerWarn) {
317 bz_sendTextMessage(BZ_SERVER, BZ_ALLUSERS, "King of the Hill enabled: more than 1 player.");
318 }
319
320 koth.onePlayerWarn = false;
321 return false;
322 }
323}
324
325void autoTime() {
326 int numPlayers =

Callers 1

processMethod · 0.85

Calls 2

bz_getTeamCountFunction · 0.85
bz_sendTextMessageFunction · 0.85

Tested by

no test coverage detected