Fix crash after item hit unloaded chunk

This commit is contained in:
Wuzzy 2017-05-30 13:59:26 +02:00
parent 4f51af2ebc
commit 7b075f5772
1 changed files with 8 additions and 6 deletions

View File

@ -398,12 +398,14 @@ core.register_entity(":__builtin:item", {
self.object:set_properties({physical = true}) self.object:set_properties({physical = true})
return return
end end
if in_unloaded and self.physical_state == true then if in_unloaded then
-- Don't infinetly fall into unloaded map if self.physical_state == true then
self.object:setvelocity({x = 0, y = 0, z = 0}) -- Don't infinetly fall into unloaded map
self.object:setacceleration({x = 0, y = 0, z = 0}) self.object:setvelocity({x = 0, y = 0, z = 0})
self.physical_state = false self.object:setacceleration({x = 0, y = 0, z = 0})
self.object:set_properties({physical = false}) self.physical_state = false
self.object:set_properties({physical = false})
end
return return
end end