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

Method GetLocalPlayerTarget

src/lua/LuaCallOuts.cpp:1891–1902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1889
1890
1891int LuaCallOuts::GetLocalPlayerTarget(lua_State* L) {
1892 const LocalPlayer* myTank = LocalPlayer::getMyTank();
1893 if (myTank == NULL) {
1894 return luaL_pushnil(L);
1895 }
1896 const Player* target = myTank->getTarget();
1897 if (target == NULL) {
1898 return luaL_pushnil(L);
1899 }
1900 lua_pushinteger(L, target->getId());
1901 return 1;
1902}
1903
1904
1905int LuaCallOuts::GetLocalTeam(lua_State* L) {

Callers

nothing calls this directly

Calls 4

luaL_pushnilFunction · 0.85
getIdMethod · 0.80
lua_pushintegerFunction · 0.50
getTargetMethod · 0.45

Tested by

no test coverage detected