mirror of
https://github.com/APercy/airutils.git
synced 2025-03-21 18:41:21 +00:00
added verification before attaching
This commit is contained in:
parent
09e6d0d42d
commit
fa935b5e51
1 changed files with 3 additions and 0 deletions
|
@ -76,6 +76,9 @@ function airutils.simple_external_attach(self, relative_pos, entity_name, radius
|
||||||
attach_up = attach_up or false
|
attach_up = attach_up or false
|
||||||
radius = radius or 12
|
radius = radius or 12
|
||||||
if self.object then
|
if self.object then
|
||||||
|
local curr_ent, curr_obj = airutils.get_attached_entity(self)
|
||||||
|
if curr_ent then return end
|
||||||
|
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
local nearby_objects = minetest.get_objects_inside_radius(pos, radius)
|
local nearby_objects = minetest.get_objects_inside_radius(pos, radius)
|
||||||
for i,obj in ipairs(nearby_objects) do
|
for i,obj in ipairs(nearby_objects) do
|
||||||
|
|
Loading…
Add table
Reference in a new issue