summaryrefslogtreecommitdiff
path: root/car.lua
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-04-22 17:55:20 -0500
committercheapie <no-email-for-you@example.com>2024-04-22 17:55:20 -0500
commite29d179464abfda76d437b4dc03c57161dca40b0 (patch)
treec96c647abb583b4aecad9e97a6472d26b0d8211a /car.lua
parentfb49406dd5f3a49dcced3891164240a679948dcc (diff)
downloadcelevator-e29d179464abfda76d437b4dc03c57161dca40b0.tar
celevator-e29d179464abfda76d437b4dc03c57161dca40b0.tar.gz
celevator-e29d179464abfda76d437b4dc03c57161dca40b0.tar.bz2
celevator-e29d179464abfda76d437b4dc03c57161dca40b0.tar.xz
celevator-e29d179464abfda76d437b4dc03c57161dca40b0.zip
Prevent crashing when minetest.get_objects_inside_radius() returns garbage
Diffstat (limited to 'car.lua')
-rw-r--r--car.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/car.lua b/car.lua
index 2f7452c..13730e8 100644
--- a/car.lua
+++ b/car.lua
@@ -679,7 +679,7 @@ minetest.register_on_player_receive_fields(function(_,formname,fields)
local cartopboxpos = vector.add(rootpos,vector.rotate_around_axis(vector.new(0,3,1),vector.new(0,1,0),rootdir))
local erefs = minetest.get_objects_inside_radius(cartopboxpos,0.5)
for _,ref in pairs(erefs) do
- if toberemoved[ref:get_luaentity().name] then
+ if ref:get_luaentity() and toberemoved[ref:get_luaentity().name] then
ref:remove()
end
end