1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2024-12-25 02:00:21 +01:00

make mobs:line_of_sight() global

This commit is contained in:
TenPlus1 2018-08-08 10:33:23 +01:00
parent 477ad59670
commit dc7cdd4df0
2 changed files with 16 additions and 0 deletions

View File

@ -281,6 +281,11 @@ local line_of_sight = function(self, pos1, pos2, stepsize)
return false return false
end 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) -- are we flying in what we are suppose to? (taikedz)
local flight_check = function(self, pos_w) local flight_check = function(self, pos_w)

11
api.txt
View File

@ -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} '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" External Settings for "minetest.conf"
------------------------------------ ------------------------------------