mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Modernize lua read (part 1): C++ templating insurance (#7394)
* Modernize lua read (part 1): C++ templating assurance Implement the float reader
This commit is contained in:
parent
86b19f2849
commit
180e551c56
9 changed files with 43 additions and 21 deletions
|
@ -43,8 +43,8 @@ int NodeTimerRef::l_set(lua_State *L)
|
|||
NodeTimerRef *o = checkobject(L, 1);
|
||||
ServerEnvironment *env = o->m_env;
|
||||
if(env == NULL) return 0;
|
||||
f32 t = luaL_checknumber(L,2);
|
||||
f32 e = luaL_checknumber(L,3);
|
||||
f32 t = readParam<float>(L,2);
|
||||
f32 e = readParam<float>(L,3);
|
||||
env->getMap().setNodeTimer(NodeTimer(t, e, o->m_p));
|
||||
return 0;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ int NodeTimerRef::l_start(lua_State *L)
|
|||
NodeTimerRef *o = checkobject(L, 1);
|
||||
ServerEnvironment *env = o->m_env;
|
||||
if(env == NULL) return 0;
|
||||
f32 t = luaL_checknumber(L,2);
|
||||
f32 t = readParam<float>(L,2);
|
||||
env->getMap().setNodeTimer(NodeTimer(t, 0, o->m_p));
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue