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

Function ParseShot

src/lua/LuaCallOuts.cpp:351–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349
350
351static inline const ShotPath* ParseShot(lua_State* L, int index) {
352 const uint32_t fullID = luaL_checkint(L, index);
353 const PlayerId playerID = (fullID >> 16);
354 const uint16_t shotID = fullID & 0xffff;
355
356 const Player* player = lookupPlayer(playerID);
357 if (player == NULL) {
358 return NULL;
359 }
360
361 const ShotPath* shot = player->getShot(shotID);
362 if ((shot == NULL) || shot->isExpired()) {
363 return NULL;
364 }
365
366 return shot;
367}
368
369
370static const std::map<std::string, TeamColor>& GetTeamNameMap() {

Callers 14

SetShotGfxBlockMethod · 0.85
GetShotGfxBlockMethod · 0.85
SetShotRadarGfxBlockMethod · 0.85
GetShotRadarGfxBlockMethod · 0.85
GetShotTypeMethod · 0.85
GetShotFlagTypeMethod · 0.85
GetShotPlayerMethod · 0.85
GetShotTeamMethod · 0.85
GetShotPositionMethod · 0.85
GetShotVelocityMethod · 0.85
GetShotLifeTimeMethod · 0.85
GetShotLeftTimeMethod · 0.85

Calls 3

isExpiredMethod · 0.80
lookupPlayerFunction · 0.50
getShotMethod · 0.45

Tested by

no test coverage detected