summaryrefslogtreecommitdiff
path: root/car.lua
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-04-21 13:35:19 -0500
committercheapie <no-email-for-you@example.com>2024-04-21 13:35:19 -0500
commitd3d844ab3199777db2d748ebdf369259184eedb9 (patch)
treeeb61f1002c0ee26eb88ceafb1080180d61dca891 /car.lua
parent881611953862e8b5a0489ea8c31d03ace364d68e (diff)
downloadcelevator-d3d844ab3199777db2d748ebdf369259184eedb9.tar
celevator-d3d844ab3199777db2d748ebdf369259184eedb9.tar.gz
celevator-d3d844ab3199777db2d748ebdf369259184eedb9.tar.bz2
celevator-d3d844ab3199777db2d748ebdf369259184eedb9.tar.xz
celevator-d3d844ab3199777db2d748ebdf369259184eedb9.zip
Fix possible crash in car top box right-click handling
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 23aa121..9d9d191 100644
--- a/car.lua
+++ b/car.lua
@@ -307,7 +307,7 @@ local pieces = {
local boxpos = vector.add(pos,vector.new(0,1,0))
local erefs = minetest.get_objects_inside_radius(boxpos,0.5)
for _,ref in pairs(erefs) do
- if ref:get_luaentity().name == "celevator:car_top_box" then
+ if ref:get_luaentity() and ref:get_luaentity().name == "celevator:car_top_box" then
local state = ref:get_properties().wield_item
if state == "celevator:car_top_box_off" then
state = "celevator:car_top_box_on"