File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,17 @@ core.register_entity(":__builtin:item", {
155
155
end
156
156
local p = self .object :getpos ()
157
157
p .y = p .y - 0.5
158
- local nn = core .get_node (p ).name
158
+ local node = core .get_node_or_nil (p )
159
+ local in_unloaded = (node == nil )
160
+ if in_unloaded then
161
+ -- Don't infinetly fall into unloaded map
162
+ self .object :setvelocity ({x = 0 , y = 0 , z = 0 })
163
+ self .object :setacceleration ({x = 0 , y = 0 , z = 0 })
164
+ self .physical_state = false
165
+ self .object :set_properties ({physical = false })
166
+ return
167
+ end
168
+ local nn = node .name
159
169
-- If node is not registered or node is walkably solid and resting on nodebox
160
170
local v = self .object :getvelocity ()
161
171
if not core .registered_nodes [nn ] or core .registered_nodes [nn ].walkable and v .y == 0 then
You can’t perform that action at this time.
0 commit comments