Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- Convert freed Object Variants (`<Freed Object>`) to `nil` when passing them to Lua
- Fixed `LuaJIT core/library version mismatch` errors in LuaJIT builds
- `LuaScriptResourceFormatLoader::_load` now respects the cache mode, fixing "Another resource is loaded from path 'res://...' (possible cyclic resource inclusion)." errors
- Error messages from Lua code using the wrong stack index


## [0.5.0](https://github.com/gilzoide/lua-gdextension/releases/tag/0.5.0)
Expand Down
2 changes: 1 addition & 1 deletion src/LuaError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ String LuaError::extract_message(const sol::load_result& load_result) {
}

String LuaError::extract_message(const sol::protected_function_result& function_result) {
return luaL_tolstring(function_result.lua_state(), function_result.stack_index(), NULL);
return luaL_tolstring(function_result.lua_state(), function_result.stack_index() + function_result.return_count() - 1, NULL);
}

}