Fix freeze in core.check_for_falling #13745
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
core.add_entity(pos, "__builtin:falling_node")
can fail if there are too many entities already. In this case,convert_to_falling_node
minetest/builtin/game/falling.lua
Lines 412 to 414 in 7b3ed32
core.check_single_for_falling
didn't forward the errorminetest/builtin/game/falling.lua
Lines 532 to 533 in 7b3ed32
core.check_for_falling
tries to remove this node againminetest/builtin/game/falling.lua
Lines 617 to 620 in 7b3ed32
To do
This PR is Ready for Review.
How to test
local obj = core.add_entity(pos, "__builtin:falling_node")
withlocal obj = nil