Skip to content

Commit

Permalink
Simplify getGameTime function usage (minetest#15187)
Browse files Browse the repository at this point in the history
  • Loading branch information
kno10 authored Sep 20, 2024
1 parent 811adf5 commit 4ac86db
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/script/lua_api/l_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 4ac86db

Please sign in to comment.