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

Function teamClear

plugins/koth/koth.cpp:523–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

521}
522
523bool teamClear(bz_eTeamType teamToCheck) {
524 if (teamToCheck == eRogueTeam || teamToCheck == eNoTeam || !koth.teamPlay) {
525 return true;
526 }
527
528 bz_APIIntList* playerList = bz_newIntList();
529 bz_getPlayerIndexList(playerList);
530
531 bool isOut = true;
532
533 for (unsigned int i = 0; i < playerList->size(); i++) {
534
535 bz_BasePlayerRecord* player = bz_getPlayerByIndex(playerList->operator[](i));
536
537 if (player) {
538 if (player->team == teamToCheck && kothzone.pointIn(player->currentState.pos) && player->spawned) {
539 isOut = false;
540 }
541 }
542
543 bz_freePlayerRecord(player);
544 }
545
546 bz_deleteIntList(playerList);
547
548 return isOut;
549}
550
551void KOTHPlayerPaused::process(bz_EventData* eventData) {
552 if (eventData->eventType != bz_ePlayerPausedEvent || !koth.enabled) {

Callers 1

processMethod · 0.85

Calls 6

bz_getPlayerIndexListFunction · 0.85
bz_freePlayerRecordFunction · 0.85
bz_deleteIntListFunction · 0.85
sizeMethod · 0.45
operator[]Method · 0.45
pointInMethod · 0.45

Tested by

no test coverage detected