mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 19:27:31 +01:00
fix crash when items in unloaded chunk
This commit is contained in:
parent
3abeed3025
commit
86d6445f42
@ -649,6 +649,12 @@ minetest.register_entity(":__builtin:item", {
|
|||||||
local node = minetest.get_node_or_nil(p)
|
local node = minetest.get_node_or_nil(p)
|
||||||
local in_unloaded = (node == nil)
|
local in_unloaded = (node == nil)
|
||||||
|
|
||||||
|
if in_unloaded then
|
||||||
|
-- Don't infinetly fall into unloaded map
|
||||||
|
disable_physics(self.object, self)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if self.is_clock then
|
if self.is_clock then
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
textures = {"mcl_clock:clock_" .. (mcl_worlds.clock_works(p) and mcl_clock.old_time or mcl_clock.random_frame)}
|
textures = {"mcl_clock:clock_" .. (mcl_worlds.clock_works(p) and mcl_clock.old_time or mcl_clock.random_frame)}
|
||||||
@ -680,11 +686,6 @@ minetest.register_entity(":__builtin:item", {
|
|||||||
enable_physics(self.object, self)
|
enable_physics(self.object, self)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if in_unloaded then
|
|
||||||
-- Don't infinetly fall into unloaded map
|
|
||||||
disable_physics(self.object, self)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Destroy item in lava, fire or special nodes
|
-- Destroy item in lava, fire or special nodes
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user