mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-01-26 00:50:21 +01:00
fix peaceful player check
This commit is contained in:
parent
088bdc5350
commit
33beec64dc
15
api.lua
15
api.lua
@ -27,7 +27,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20221021",
|
version = "20221027",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -1895,14 +1895,17 @@ end
|
|||||||
-- peaceful player privilege support
|
-- peaceful player privilege support
|
||||||
local function is_peaceful_player(player)
|
local function is_peaceful_player(player)
|
||||||
|
|
||||||
|
-- main setting enabled
|
||||||
if peaceful_player_enabled then
|
if peaceful_player_enabled then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
|
|
||||||
if player_name
|
-- player priv enabled
|
||||||
and minetest.check_player_privs(player_name, "peaceful_player") then
|
if player_name
|
||||||
return true
|
and minetest.check_player_privs(player_name, "peaceful_player") then
|
||||||
end
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user