| 349 | |
| 350 | |
| 351 | static 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 | |
| 370 | static const std::map<std::string, TeamColor>& GetTeamNameMap() { |
no test coverage detected