diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 4c8d2f0..e09a735 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -1,5 +1,8 @@ -- mods/default/functions.lua +-- Check for a volume intersecting protection +local is_50 = minetest.has_feature("object_use_texture_alpha") or nil + -- -- Sounds -- @@ -488,6 +491,9 @@ minetest.register_abm({ function default.intersects_protection(minp, maxp, player_name, interval) -- 'interval' is the largest allowed interval for the 3D lattice of checks +if is_50 then + return minetest.is_area_protected(minp, maxp, player_name, interval) +else -- Compute the optimal float step 'd' for each axis so that all corners and -- borders are checked. 'd' will be smaller or equal to 'interval'. -- Subtracting 1e-4 ensures that the max co-ordinate will be reached by the @@ -518,6 +524,9 @@ function default.intersects_protection(minp, maxp, player_name, interval) end return false + +end + end