Don't change mob name tag color

This commit is contained in:
Wuzzy 2017-01-21 14:42:55 +01:00
parent 5d1bb3a8e8
commit 15d569b769

View file

@ -262,31 +262,6 @@ function effect(pos, amount, texture, min_size, max_size, radius, gravity)
}) })
end end
-- update nametag colour
function update_tag(self)
local col = "#00FF00"
local qua = self.hp_max / 4
if self.health <= floor(qua * 3) then
col = "#FFFF00"
end
if self.health <= floor(qua * 2) then
col = "#FF6600"
end
if self.health <= floor(qua) then
col = "#FF0000"
end
self.object:set_properties({
nametag = self.nametag,
nametag_color = col
})
end
-- check if mob is dead or only hurt -- check if mob is dead or only hurt
function check_for_death(self) function check_for_death(self)
@ -321,8 +296,6 @@ function check_for_death(self)
self.htimer = 2 self.htimer = 2
update_tag(self)
return false return false
end end
@ -446,8 +419,6 @@ do_env_damage = function(self)
self.nametag = self.nametag2 self.nametag = self.nametag2
self.nametag2 = nil self.nametag2 = nil
update_tag(self)
end end
local pos = self.object:getpos() local pos = self.object:getpos()
@ -2141,7 +2112,6 @@ local mob_activate = function(self, staticdata, dtime_s, def)
-- set anything changed above -- set anything changed above
self.object:set_properties(self) self.object:set_properties(self)
update_tag(self)
end end
local mob_step = function(self, dtime) local mob_step = function(self, dtime)
@ -3005,8 +2975,6 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
self.object:set_hp(self.health) self.object:set_hp(self.health)
update_tag(self)
-- make children grow quicker -- make children grow quicker
if self.child == true then if self.child == true then
@ -3099,8 +3067,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
-- update nametag -- update nametag
mob_obj[name].nametag = fields.name mob_obj[name].nametag = fields.name
update_tag(mob_obj[name])
-- if not in creative then take item -- if not in creative then take item
if not creative then if not creative then