Item Entity: prevent moveresult assert when attached (#13353)

This commit is contained in:
mazes-80 2023-06-05 12:00:11 +02:00 committed by GitHub
parent e5a5d5a672
commit 23f7aab354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -178,6 +178,11 @@ core.register_entity(":__builtin:item", {
return
end
-- Prevent assert when item_entity is attached
if moveresult == nil and self.object:get_attach() then
return
end
if self.force_out then
-- This code runs after the entity got a push from the is_stuck code.
-- It makes sure the entity is entirely outside the solid node