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

Function lookupPlayer

src/clientbase/Roster.cpp:31–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29
30
31Player* lookupPlayer(PlayerId id) {
32 // check my tank first
33
34 LocalPlayer* myTank = LocalPlayer::getMyTank();
35 if (myTank && myTank->getId() == id) {
36 return myTank;
37 }
38
39 if (id == ServerPlayer) {
40 World* world = World::getWorld();
41 if (world) {
42 return world->getWorldWeapons();
43 }
44 else {
45 return NULL;
46 }
47 }
48
49 if ((id < curMaxPlayers) && remotePlayers[id] &&
50 (remotePlayers[id]->getId() == id)) {
51 return remotePlayers[id];
52 }
53
54 // it's nobody we know about
55 return NULL;
56}
57
58
59#ifdef ROBOT

Callers 15

ShockWaveStrategyMethod · 0.70
updateMethod · 0.70
_predictMethod · 0.70
updateFlagMethod · 0.70
SegmentedShotStrategyMethod · 0.70
handleSetShotTypeFunction · 0.70
handleSetTeamFunction · 0.70
handleAllowFunction · 0.70
handleDropFlagFunction · 0.70
handleShotEndFunction · 0.70
handleTransferFlagFunction · 0.70
handlePlayerInfoFunction · 0.70

Calls 2

getIdMethod · 0.80
getWorldWeaponsMethod · 0.80

Tested by

no test coverage detected