From eef62c82a2e58700fc1216b0b8c03e421bc77995 Mon Sep 17 00:00:00 2001 From: Loïc Blot Date: Sat, 30 Jun 2018 17:11:38 +0200 Subject: 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 --- src/script/cpp_api/s_entity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script/cpp_api/s_entity.cpp') diff --git a/src/script/cpp_api/s_entity.cpp b/src/script/cpp_api/s_entity.cpp index 88dbcc620..a3f7fa68b 100644 --- a/src/script/cpp_api/s_entity.cpp +++ b/src/script/cpp_api/s_entity.cpp @@ -257,7 +257,7 @@ bool ScriptApiEntity::luaentity_Punch(u16 id, setOriginFromTable(object); PCALL_RES(lua_pcall(L, 6, 1, error_handler)); - bool retval = lua_toboolean(L, -1); + bool retval = readParam(L, -1); lua_pop(L, 2); // Pop object and error handler return retval; } @@ -287,7 +287,7 @@ bool ScriptApiEntity::luaentity_run_simple_callback(u16 id, setOriginFromTable(object); PCALL_RES(lua_pcall(L, 2, 1, error_handler)); - bool retval = lua_toboolean(L, -1); + bool retval = readParam(L, -1); lua_pop(L, 2); // Pop object and error handler return retval; } -- cgit v1.2.3