nil checks
This commit is contained in:
parent
f54c3da9d7
commit
fb42be6b28
6
api.lua
6
api.lua
@ -28,7 +28,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20220313",
|
version = "20220314",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -276,7 +276,7 @@ local check_for = function(look_for, look_inside)
|
|||||||
|
|
||||||
if str and str:find("group:") then
|
if str and str:find("group:") then
|
||||||
|
|
||||||
local group = str:split(":")[2]
|
local group = str:split(":")[2] or ""
|
||||||
|
|
||||||
if minetest.get_item_group(look_for, group) ~= 0 then
|
if minetest.get_item_group(look_for, group) ~= 0 then
|
||||||
return true
|
return true
|
||||||
@ -2132,7 +2132,7 @@ function mob_class:follow_flop()
|
|||||||
|
|
||||||
for n = 1, #players do
|
for n = 1, #players do
|
||||||
|
|
||||||
if get_distance(players[n]:get_pos(), s) < self.view_range
|
if players[n] and get_distance(players[n]:get_pos(), s) < self.view_range
|
||||||
and not is_invisible(self, players[n]:get_player_name()) then
|
and not is_invisible(self, players[n]:get_player_name()) then
|
||||||
|
|
||||||
self.following = players[n]
|
self.following = players[n]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user