| 2454 | |
| 2455 | |
| 2456 | int 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 | |
| 2475 | int LuaCallOuts::GetPlayerOpacity(lua_State* L) { |
nothing calls this directly
no test coverage detected