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

Function handleDropFlag

src/clientbase/playing.cpp:1391–1411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1389
1390
1391void 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
1414void handleShotEnd(void* msg) {

Callers 1

handleServerMessageFunction · 0.85

Calls 8

nboUnpackUInt8Function · 0.85
nboUnpackUInt16Function · 0.85
getMaxFlagsMethod · 0.80
getFlagMethod · 0.80
lookupPlayerFunction · 0.70
handleFlagDroppedFunction · 0.50
unpackMethod · 0.45
FlagDroppedMethod · 0.45

Tested by

no test coverage detected