mirror of
https://github.com/minetest/minetest.git
synced 2025-01-03 03:47:31 +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;
|
||||
|
||||
// Do it
|
||||
int timeofday_mh = env->getTimeOfDay();
|
||||
float timeofday_f = (float)timeofday_mh / 24000.0f;
|
||||
lua_pushnumber(L, timeofday_f);
|
||||
lua_pushnumber(L, env->getTimeOfDayF());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -770,8 +767,7 @@ int ModApiEnv::l_get_gametime(lua_State *L)
|
||||
{
|
||||
GET_ENV_PTR;
|
||||
|
||||
int game_time = env->getGameTime();
|
||||
lua_pushnumber(L, game_time);
|
||||
lua_pushnumber(L, env->getGameTime());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user