File tree Expand file tree Collapse file tree
scripts/python/API/plugins/lua_link/lua Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -446,15 +446,20 @@ function olyLink.clearZone(zoneName)
446446 id = world .VolumeType .SPHERE ,
447447 params = {
448448 point = mist .utils .makeVec3GL (zone .point ),
449- radius = zone . radius
449+ radius = 5000
450450 }
451451 }
452452
453453 local foundObjects = 0
454454 local function tryRemove (obj )
455455 foundObjects = foundObjects + 1
456456 if obj and obj :isExist () then
457- obj :destroy ()
457+ -- Check if the distance between the object and the zone center is less than the zone radius, ignoring height
458+ local objPosition = obj :getPosition ().p
459+ local distance = math.sqrt ((objPosition .x - zone .point .x )^ 2 + (objPosition .z - zone .point .z )^ 2 )
460+ if distance <= zone .radius then
461+ obj :destroy ()
462+ end
458463 end
459464 return true
460465 end
You can’t perform that action at this time.
0 commit comments