fix peaceful player check

This commit is contained in:
tenplus1 2022-10-27 16:57:53 +01:00
parent 088bdc5350
commit 33beec64dc
1 changed files with 9 additions and 6 deletions

15
api.lua
View File

@ -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