mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-23 08:29:34 +01:00
fix crash when items in unloaded chunk
This commit is contained in:
parent
3abeed3025
commit
86d6445f42
1 changed files with 6 additions and 5 deletions
|
@ -649,6 +649,12 @@ minetest.register_entity(":__builtin:item", {
|
|||
local node = minetest.get_node_or_nil(p)
|
||||
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
|
||||
self.object:set_properties({
|
||||
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)
|
||||
return
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue