summaryrefslogtreecommitdiff
path: root/drive_entity.lua
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2026-09-06 10:02:45 -0500
committercheapie <cheapiephp@gmail.com>2026-09-06 10:02:45 -0500
commitf93882995bd4efb699f00b3f2a7eec04603c28af (patch)
tree3dc500cfe656875f3d4af70dae0ce9c4205885a9 /drive_entity.lua
parentffee31080cdafa0b2cdf81848c071c76c95e4157 (diff)
downloadcelevator-f93882995bd4efb699f00b3f2a7eec04603c28af.tar
celevator-f93882995bd4efb699f00b3f2a7eec04603c28af.tar.gz
celevator-f93882995bd4efb699f00b3f2a7eec04603c28af.tar.bz2
celevator-f93882995bd4efb699f00b3f2a7eec04603c28af.tar.xz
celevator-f93882995bd4efb699f00b3f2a7eec04603c28af.zip
Detect when certain entities shouldn't be attachedHEADmain
Diffstat (limited to 'drive_entity.lua')
-rw-r--r--drive_entity.lua7
1 files changed, 5 insertions, 2 deletions
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)