summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-08-08 10:33:23 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2018-08-08 10:33:23 +0100
commitdc7cdd4df0f8e31195e770e00c0a3933c1acabe2 (patch)
tree1075a7850b3765418f6df25e890ea56c928322ab
parent477ad596703011af7eded7070e3bfb2c3bef7587 (diff)
make mobs:line_of_sight() global
-rw-r--r--api.lua5
-rw-r--r--api.txt11
2 files changed, 16 insertions, 0 deletions
diff --git a/api.lua b/api.lua
index 4475ffa..8dd2ce5 100644
--- a/api.lua
+++ b/api.lua
@@ -281,6 +281,11 @@ local line_of_sight = function(self, pos1, pos2, stepsize)
return false
end
+-- global function
+mobs:line_of_sight = function(self, pos1, pos2, stepsize)
+ return local line_of_sight = function(self, pos1, pos2, stepsize)
+end
+
-- are we flying in what we are suppose to? (taikedz)
local flight_check = function(self, pos_w)
diff --git a/api.txt b/api.txt
index 57e086c..eeb2713 100644
--- a/api.txt
+++ b/api.txt
@@ -559,6 +559,17 @@ Certain variables need to be set before using the above functions:
'self.driver_scale' sets driver scale for mobs larger than {x=1, y=1}
+mobs:line_of_sight(self, pos1, pos2, stepsize)
+
+This function is for use within the mobs definition for special use cases and
+returns true if a mob can see the player or victim.
+
+...'self' mob information
+ 'pos1' position of mob
+ 'pos2' position of vistim or player
+ 'stepsize' usually set to 1
+
+
External Settings for "minetest.conf"
------------------------------------