From be3f961e26566a0c5b858758a55461147ed60aa4 Mon Sep 17 00:00:00 2001 From: Peter Maloney Date: Thu, 16 Jul 2015 23:33:56 +0200 Subject: [PATCH] made lasers 10x more precise --- technic/tools/mining_lasers.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/technic/tools/mining_lasers.lua b/technic/tools/mining_lasers.lua index 4c83ae9..476d774 100644 --- a/technic/tools/mining_lasers.lua +++ b/technic/tools/mining_lasers.lua @@ -132,7 +132,11 @@ local function laser_shoot(player, range, particle_texture, sound) texture = particle_texture .. "^[transform" .. math.random(0, 7), }) minetest.sound_play(sound, {pos = player_pos, max_hear_distance = range}) - for pos in rayIter(start_pos, dir, range) do + --rayIter is integer math... so make it more precise by multiplying pos and range here + start_pos_10x = vector.multiply(start_pos, 10) + for pos in rayIter(start_pos_10x, dir, range*10) do + --reverse the above multiplying here + pos = vector.multiply(pos, 0.1) if minetest.is_protected(pos, player_name) then minetest.record_protection_violation(pos, player_name) break