mirror of
https://github.com/minetest/minetest.git
synced 2025-01-05 04:47:30 +01:00
Simplify getGameTime function usage (#15187)
This commit is contained in:
parent
811adf5d42
commit
4ac86db8e3
@ -749,10 +749,7 @@ int ModApiEnv::l_get_timeofday(lua_State *L)
|
|||||||
{
|
{
|
||||||
GET_PLAIN_ENV_PTR;
|
GET_PLAIN_ENV_PTR;
|
||||||
|
|
||||||
// Do it
|
lua_pushnumber(L, env->getTimeOfDayF());
|
||||||
int timeofday_mh = env->getTimeOfDay();
|
|
||||||
float timeofday_f = (float)timeofday_mh / 24000.0f;
|
|
||||||
lua_pushnumber(L, timeofday_f);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -770,8 +767,7 @@ int ModApiEnv::l_get_gametime(lua_State *L)
|
|||||||
{
|
{
|
||||||
GET_ENV_PTR;
|
GET_ENV_PTR;
|
||||||
|
|
||||||
int game_time = env->getGameTime();
|
lua_pushnumber(L, env->getGameTime());
|
||||||
lua_pushnumber(L, game_time);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user