From f93882995bd4efb699f00b3f2a7eec04603c28af Mon Sep 17 00:00:00 2001 From: cheapie Date: Sun, 6 Sep 2026 10:02:45 -0500 Subject: Detect when certain entities shouldn't be attached --- drive_entity.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drive_entity.lua') diff --git a/drive_entity.lua b/drive_entity.lua index edc47c6..5abc477 100644 --- a/drive_entity.lua +++ b/drive_entity.lua @@ -399,9 +399,12 @@ function celevator.drives.entity.nodestoentities(nodes,ename) ["celevator:car_door"] = true, ["celevator:tapehead"] = true, } + local donotattach = { + ["bike:bike"] = true, -- This mod crashes if this entity is attached + } if attachref:get_luaentity() and included[attachref:get_luaentity().name] then table.insert(refs,attachref) - elseif attachref:is_player() then + elseif attachref:is_player() and not attachref:get_attach() then local attachpos = attachref:get_pos() local basepos = eref:get_pos() local attachoffset = vector.subtract(attachpos,basepos) @@ -416,7 +419,7 @@ function celevator.drives.entity.nodestoentities(nodes,ename) zmin = zmin-extra, zmax = zmax+extra, } - else + elseif attachref:get_luaentity() and not (attachref:get_attach() or donotattach[attachref:get_luaentity().name or ""]) then local attachpos = attachref:get_pos() local basepos = eref:get_pos() local attachoffset = vector.subtract(attachpos,basepos) -- cgit v1.2.3