| 251 | |
| 252 | |
| 253 | void RabidRabbitEventHandler::process(bz_EventData* eventData) { |
| 254 | if ((eventData->eventType != bz_eTickEvent) || (zoneList.size() < 2)) { |
| 255 | return; |
| 256 | } |
| 257 | |
| 258 | for (unsigned int i = 0; i < zoneList.size(); i++) { |
| 259 | if (!zoneList[i].WWFired && rrzoneinfo.currentKillZone == i) { |
| 260 | bz_fireWorldWep(zoneList[i].WW.c_str(), zoneList[i].WWLifetime, zoneList[i].WWPosition, zoneList[i].WWTilt, |
| 261 | zoneList[i].WWDirection, zoneList[i].WWShotID, zoneList[i].WWDT); |
| 262 | zoneList[i].WWFired = true; |
| 263 | zoneList[i].WWLastFired = bz_getCurrentTime(); |
| 264 | } |
| 265 | else { |
| 266 | if ((bz_getCurrentTime() - zoneList[i].WWLastFired) > zoneList[i].WWRepeat) { |
| 267 | zoneList[i].WWFired = false; |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | |
| 273 | bz_APIIntList* playerList = bz_newIntList(); |
| 274 | bz_getPlayerIndexList(playerList); |
| 275 | |
| 276 | for (unsigned int h = 0; h < playerList->size(); h++) { |
| 277 | bz_BasePlayerRecord* player = bz_getPlayerByIndex(playerList->operator[](h)); |
| 278 | |
| 279 | if (player) { |
| 280 | |
| 281 | for (unsigned int i = 0; i < zoneList.size(); i++) { |
| 282 | if (zoneList[i].pointIn(player->currentState.pos) && player->spawned && player->team == eRabbitTeam |
| 283 | && rrzoneinfo.currentKillZone != i && !rrzoneinfo.rabbitNotifiedWrongZone) { |
| 284 | bz_sendTextMessage(BZ_SERVER, player->playerID, "You are not in the current Rabid Rabbit zone - try another."); |
| 285 | rrzoneinfo.rabbitNotifiedWrongZone = true; |
| 286 | rrzoneinfo.rabbitNotifiedWrongZoneNum = i; |
| 287 | } |
| 288 | |
| 289 | if (!zoneList[i].pointIn(player->currentState.pos) && player->spawned && player->team == eRabbitTeam |
| 290 | && rrzoneinfo.rabbitNotifiedWrongZone && rrzoneinfo.rabbitNotifiedWrongZoneNum == i) { |
| 291 | rrzoneinfo.rabbitNotifiedWrongZone = false; |
| 292 | } |
| 293 | |
| 294 | if (zoneList[i].pointIn(player->currentState.pos) && player->spawned && player->team == eRabbitTeam |
| 295 | && rrzoneinfo.currentKillZone == i && bz_getTeamCount(eHunterTeam) > 0) { |
| 296 | killAllHunters(zoneList[i].servermessage); |
| 297 | |
| 298 | rrzoneinfo.rabbitNotifiedWrongZone = true; |
| 299 | rrzoneinfo.rabbitNotifiedWrongZoneNum = i; |
| 300 | |
| 301 | if (i == (zoneList.size() - 1)) { |
| 302 | rrzoneinfo.currentKillZone = 0; |
| 303 | } |
| 304 | else { |
| 305 | rrzoneinfo.currentKillZone++; |
| 306 | } |
| 307 | |
| 308 | rrzoneinfo.rabbitNotifiedWrongZone = true; |
| 309 | rrzoneinfo.rabbitNotifiedWrongZoneNum = i; |
| 310 | } |
nothing calls this directly
no test coverage detected