| 220 | } |
| 221 | |
| 222 | void killAllHunters(std::string messagepass) { |
| 223 | bz_APIIntList* playerList = bz_newIntList(); |
| 224 | bz_getPlayerIndexList(playerList); |
| 225 | |
| 226 | |
| 227 | for (unsigned int i = 0; i < playerList->size(); i++) { |
| 228 | |
| 229 | bz_BasePlayerRecord* player = bz_getPlayerByIndex(playerList->operator[](i)); |
| 230 | |
| 231 | if (player) { |
| 232 | if (player->team != eRabbitTeam) { |
| 233 | bz_killPlayer(player->playerID, true, BZ_SERVER); |
| 234 | bz_sendTextMessage(BZ_SERVER, player->playerID, messagepass.c_str()); |
| 235 | if (rrzoneinfo.soundEnabled) { |
| 236 | bz_sendPlayCustomLocalSound(player->playerID, "flag_lost"); |
| 237 | } |
| 238 | } |
| 239 | if (player->team == eRabbitTeam && rrzoneinfo.soundEnabled && bz_getTeamCount(eHunterTeam) > 0) { |
| 240 | bz_sendPlayCustomLocalSound(player->playerID, "flag_won"); |
| 241 | } |
| 242 | |
| 243 | bz_freePlayerRecord(player); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | bz_deleteIntList(playerList); |
| 248 | |
| 249 | return; |
| 250 | } |
| 251 | |
| 252 | |
| 253 | void RabidRabbitEventHandler::process(bz_EventData* eventData) { |
no test coverage detected