summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-06-17 11:22:04 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-06-17 11:22:04 +0100
commitd1bee49785453aaaed95b1fbe0c31225de5cb9ce (patch)
tree15a4fe3644e78815adcaab0efb85de7cc0da9cdf
parentdb7e02af1a8e674934ce6646516e25f5a2b88aca (diff)
Added extra check for line of sight when flying in custom node.
-rw-r--r--api.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/api.lua b/api.lua
index 945f781..80d53fc 100644
--- a/api.lua
+++ b/api.lua
@@ -1,5 +1,5 @@
--- Mobs Api (11th June 2016)
+-- Mobs Api (17th June 2016)
mobs = {}
mobs.mod = "redo"
@@ -216,6 +216,17 @@ function line_of_sight_water(self, pos1, pos2, stepsize)
return true
end
+
+ -- just incase we have a special node for flying/swimming mobs
+ elseif s == false
+ and self.fly
+ and self.fly_in then
+
+ local nod = minetest.get_node(pos_w).name
+
+ if nod == self.fly_in then
+ return true
+ end
end
return false