diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2017-04-20 19:09:44 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2017-04-20 19:09:44 +0100 |
commit | b2083fd120b7cef05b54d13ae69c6b0181a164e3 (patch) | |
tree | 390a6ec87d13ae0619ed668a4ce5158e1f094fd3 | |
parent | ed28e9efea55b8400360b9acd412755324bc3479 (diff) |
line of sight only counts "normal" nodeboxes as obstruction
-rw-r--r-- | api.lua | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ --- Mobs Api (19th April 2017) +-- Mobs Api (20th April 2017) mobs = {} mobs.mod = "redo" @@ -197,9 +197,11 @@ function line_of_sight(self, pos1, pos2, stepsize) -- Actual Distance (ad) traveled local ad = 0 - -- It continues to advance in the line of sight in search of a real obstruction. + -- It continues to advance in the line of sight in search of a real + -- obstruction which counts as 'normal' nodebox. while minetest.registered_nodes[nn] - and minetest.registered_nodes[nn].walkable == false do + and (minetest.registered_nodes[nn].walkable == false + or minetest.registered_nodes[nn].drawtype == "nodebox") do -- Check if you can still move forward if td < ad + stepsize then |