diff --git a/include/Nazara/Lua/LuaInstance.inl b/include/Nazara/Lua/LuaInstance.inl index f9c9d823e..6a1a35e24 100644 --- a/include/Nazara/Lua/LuaInstance.inl +++ b/include/Nazara/Lua/LuaInstance.inl @@ -18,22 +18,28 @@ double NzLuaImplQueryArg(NzLuaInstance& instance, unsigned int index, NzTypeTag< float NzLuaImplQueryArg(NzLuaInstance& instance, unsigned int index, NzTypeTag) { - return instance.CheckNumber(index); + return static_cast(instance.CheckNumber(index)); } int NzLuaImplQueryArg(NzLuaInstance& instance, unsigned int index, NzTypeTag) { - return instance.CheckInteger(index); + return static_cast(instance.CheckInteger(index)); } std::string NzLuaImplQueryArg(NzLuaInstance& instance, unsigned int index, NzTypeTag) { - return instance.CheckString(index); + std::size_t strLength = 0; + const char* str = instance.CheckString(index, &strLength); + + return std::string(str, strLength); } NzString NzLuaImplQueryArg(NzLuaInstance& instance, unsigned int index, NzTypeTag) { - return instance.CheckString(index); + std::size_t strLength = 0; + const char* str = instance.CheckString(index, &strLength); + + return NzString(str, strLength); } template