Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placing upside-down slabs can crash server #115

Closed
ShadowNinja opened this issue Jan 27, 2013 · 3 comments
Closed

Placing upside-down slabs can crash server #115

ShadowNinja opened this issue Jan 27, 2013 · 3 comments

Comments

@ShadowNinja
Copy link
Member

If you place a slab on the side of an upside-down slab and the position where the new slab should be placed is already used(for example by a mesecon)

screenshot_2105257804

the server will crash with the error:
.../minetest/games/minetest_game/mods/stairs/init.lua:184: attempt to index local 'ret' (a nil value)

and at line 184 we have:

local fakestack = ItemStack("stairs:slab_" .. subname.."upside_down")
local ret = minetest.item_place(fakestack, placer, pointed_thing)
if ret:is_empty() then    --line 184

shoudn't this be:
if ret and ret:is_empty() then

@PilzAdam
Copy link
Contributor

I wonder if its rather a bug in minetest.item_place. There is no documentation of the return value of it in doc/lua-api.txt but I think it should always return an ItemStack.

@ShadowNinja
Copy link
Member Author

@PilzAdam: Should I post an issue with the engine then?

@PilzAdam
Copy link
Contributor

PilzAdam commented Feb 4, 2013

@ShadowNinja: Yea, something like "Inconsistent return value of minetest.item_place()".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants