]> git.lizzy.rs Git - worldedit.git/blobdiff - worldedit_brush/init.lua
Use eye_height property for brush raytracing
[worldedit.git] / worldedit_brush / init.lua
index 69ca25c01d6f09939d99b5ce7ee7089d329e4bd7..915214ce5d3515003f4378d4299304cf041cce6f 100644 (file)
@@ -51,7 +51,8 @@ local brush_on_use = function(itemstack, placer)
                return false
        end
 
-       local raybegin = vector.add(placer:get_pos(), {x=0, y=2, z=0}) -- player head
+       local raybegin = vector.add(placer:get_pos(),
+               {x=0, y=placer:get_properties().eye_height, z=0})
        local rayend = vector.add(raybegin, vector.multiply(placer:get_look_dir(), BRUSH_MAX_DIST))
        local ray = minetest.raycast(raybegin, rayend, false, true)
        local pointed_thing = ray:next()