diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 6fd0e2b2a..a024d7e42 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -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; }