From c06d071220d34fb08923d3df7bca0e09d13ffd51 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Wed, 7 Apr 2021 10:35:36 +0100 Subject: [PATCH] allow players with 'protection_bypass' to rename owned tamed mobs --- api.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api.lua b/api.lua index d992152..9398cda 100644 --- a/api.lua +++ b/api.lua @@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20210406", + version = "20210407", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } @@ -4730,12 +4730,12 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame) end local item = clicker:get_wielded_item() + local name = clicker:get_player_name() -- if mob has been tamed you can name it with a nametag if item:get_name() == "mobs:nametag" - and clicker:get_player_name() == self.owner then - - local name = clicker:get_player_name() + and (name == self.owner + or minetest.check_player_privs(name, "protection_bypass")) then -- store mob and nametag stack in external variables mob_obj[name] = self