From 7b075f577222da234bb6a60add65fe1707ed19cc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 30 May 2017 13:59:26 +0200 Subject: [PATCH] Fix crash after item hit unloaded chunk --- mods/ENTITIES/mcl_item_entity/init.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 8af3550fc8..060caac676 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -398,12 +398,14 @@ core.register_entity(":__builtin:item", { self.object:set_properties({physical = true}) return end - if in_unloaded and self.physical_state == true then - -- Don't infinetly fall into unloaded map - self.object:setvelocity({x = 0, y = 0, z = 0}) - self.object:setacceleration({x = 0, y = 0, z = 0}) - self.physical_state = false - self.object:set_properties({physical = false}) + if in_unloaded then + if self.physical_state == true then + -- Don't infinetly fall into unloaded map + self.object:setvelocity({x = 0, y = 0, z = 0}) + self.object:setacceleration({x = 0, y = 0, z = 0}) + self.physical_state = false + self.object:set_properties({physical = false}) + end return end