mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Modernize lua read (part 2 & 3): C++ templating assurance (#7410)
* Modernize lua read (part 2 & 3): C++ templating assurance Implement the boolean reader Implement the string reader Also remove unused & unimplemented script_error_handler Add a reader with default value
This commit is contained in:
parent
227c71eb76
commit
eef62c82a2
35 changed files with 247 additions and 154 deletions
|
@ -66,7 +66,7 @@ int ModApiParticles::l_add_particle(lua_State *L)
|
|||
acc = check_v3f(L, 3);
|
||||
expirationtime = luaL_checknumber(L, 4);
|
||||
size = luaL_checknumber(L, 5);
|
||||
collisiondetection = lua_toboolean(L, 6);
|
||||
collisiondetection = readParam<bool>(L, 6);
|
||||
texture = luaL_checkstring(L, 7);
|
||||
if (lua_gettop(L) == 8) // only spawn for a single player
|
||||
playername = luaL_checkstring(L, 8);
|
||||
|
@ -177,7 +177,7 @@ int ModApiParticles::l_add_particlespawner(lua_State *L)
|
|||
maxexptime = luaL_checknumber(L, 10);
|
||||
minsize = luaL_checknumber(L, 11);
|
||||
maxsize = luaL_checknumber(L, 12);
|
||||
collisiondetection = lua_toboolean(L, 13);
|
||||
collisiondetection = readParam<bool>(L, 13);
|
||||
texture = luaL_checkstring(L, 14);
|
||||
if (lua_gettop(L) == 15) // only spawn for a single player
|
||||
playername = luaL_checkstring(L, 15);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue