2 Commits 38ad340040 ... f708f8ea31

Author SHA1 Message Date
  Diaeresis f708f8ea31 Fix IRC death messages this time for real maybe 7 months ago
  Diaeresis b9f857e104 Hide player gauges when full 7 months ago
2 changed files with 6 additions and 3 deletions
  1. 2 1
      mods/HUD/death_messages/init.lua
  2. 4 2
      mods/HUD/gauges/init.lua

+ 2 - 1
mods/HUD/death_messages/init.lua

@@ -331,7 +331,8 @@ minetest.register_on_dieplayer(function(player)
 	death_messages.reset_watchers(player)
 
 	if irc and irc.connected then
-		irc.say(string.gsub(message, "%(player%)", name))
+		-- frankly no idea why the strip_colors is needed, it shouldn't be containing colors but it won't send otherwise
+		irc.say(minetest.strip_colors(string.gsub(message, "%(player%)", name)))
 	end
 end)
 

+ 4 - 2
mods/HUD/gauges/init.lua

@@ -35,10 +35,12 @@ minetest.register_entity("gauges:hp_bar", {
 		local breath = player:get_breath() <= 10 and player:get_breath() or 11
 
 		if self.hp ~= hp or self.breath ~= breath then
+			local hp_tex = hp < 20 and "health_"..tostring(hp)..".png" or "blank.png"
+			local breath_tex = breath < 10 and "breath_"..tostring(breath)..".png" or "blank.png"
+
 			gauge:set_properties({
 				textures = {
-					"health_"..tostring(hp)..".png^"..
-					"breath_"..tostring(breath)..".png"
+					hp_tex .. "^" .. breath_tex
 				}
 			})
 			self.hp = hp