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
Item Entity: Prevent moveresult assert when attached #13353
Conversation
What I meant is that attaching an item object to something (what the mod does) is a bad idea. It's generally safer to register a new entity that looks like the dropped item, but does not do the other things, like being pick-up-able or moving out of nodes. For example, pipeworks and factory do this.
Idk if the assert should be skipped. |
MTG carts solves it by calling I think this fix makes sense. Calling this special function should not be necessary to e.g. carry items with another object. |
Thank for the hint. That was already the workaround I ended up with for the chakram mod. |
7112c1b
to
343e7a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
343e7a0
to
7e13f05
Compare
Moveresult is assigned only when no parents
minetest/src/server/luaentity_sao.cpp
Lines 150 to 181 in baf99f8
An assertion is launched if no moveresult for __builtin:item
minetest/builtin/game/item_entity.lua
Lines 204 to 205 in baf99f8
This PR proposes to slip off the assert. It originated in fixing one mod that worked flawlessly until minetest-5.3.0. Each time weapon grabbed an an item entity the server restarted with the message from the culprit assert, which was sad as grabbing items is one of the purposes of this mod. I ended up seeing why the mod was not doing anything bad today, when the message states it is because of the mod.
Via #minetest Desour states it may not be good to skip action for item entity. I hope it was just an immediate reaction and nothing is really bad de-charging some position computation on parent for some steps.
In case skipping steps is really bad, silently disable attaching when __builtin and/or document, seems a valid path.