| 1389 | |
| 1390 | |
| 1391 | void handleDropFlag(void* msg) { |
| 1392 | PlayerId id; |
| 1393 | uint16_t flagIndex; |
| 1394 | |
| 1395 | msg = nboUnpackUInt8(msg, id); |
| 1396 | msg = nboUnpackUInt16(msg, flagIndex); |
| 1397 | if (flagIndex >= world->getMaxFlags()) { |
| 1398 | return; |
| 1399 | } |
| 1400 | Flag& flag = world->getFlag(int(flagIndex)); |
| 1401 | msg = flag.unpack(msg); |
| 1402 | |
| 1403 | Player* tank = lookupPlayer(id); |
| 1404 | if (!tank) { |
| 1405 | return; |
| 1406 | } |
| 1407 | |
| 1408 | handleFlagDropped(tank); |
| 1409 | |
| 1410 | eventHandler.FlagDropped(flag, *tank); |
| 1411 | } |
| 1412 | |
| 1413 | |
| 1414 | void handleShotEnd(void* msg) { |
no test coverage detected