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

Method GetPlayerExplodeTime

src/lua/LuaCallOuts.cpp:2456–2472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2454
2455
2456int LuaCallOuts::GetPlayerExplodeTime(lua_State* L) {
2457 const Player* player = ParsePlayer(L, 1);
2458 if (player == NULL) {
2459 return luaL_pushnil(L);
2460 }
2461 if (!player->isExploding()) {
2462 return luaL_pushnil(L);
2463 }
2464 const BzTime current = BzTime::getTick();
2465 const BzTime explode = player->getExplodeTime();
2466 const float explodeTime = (float)(current - explode);
2467 if (explodeTime < 0.0f) {
2468 return luaL_pushnil(L); // should not happen
2469 }
2470 lua_pushfloat(L, explodeTime);
2471 return 1;
2472}
2473
2474
2475int LuaCallOuts::GetPlayerOpacity(lua_State* L) {

Callers

nothing calls this directly

Calls 4

ParsePlayerFunction · 0.85
luaL_pushnilFunction · 0.85
lua_pushfloatFunction · 0.85
isExplodingMethod · 0.80

Tested by

no test coverage detected