Tooltip error on character sheet with Acidic Skin

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Tooltip error on character sheet with Acidic Skin

#1 Post by Hachem_Muche »

The "acid disarm" damage type returns a table rather than a number causing Lua errors in the character sheet. Fixed with the following patch (provided the index 'dam' is a number in the table):

Code: Select all

Index: modules/tome/dialogs/CharacterSheet.lua
===================================================================
--- modules/tome/dialogs/CharacterSheet.lua	(revision 6196)
+++ modules/tome/dialogs/CharacterSheet.lua	(working copy)
@@ -873,7 +873,8 @@
 
 		for i, t in ipairs(DamageType.dam_def) do
 			if player.on_melee_hit[DamageType[t.type]] and player.on_melee_hit[DamageType[t.type]] ~= 0 then
-				self:mouseTooltip(self.TOOLTIP_ON_HIT_DAMAGE, s:drawColorStringBlended(self.font, ("%s%-10s#LAST#: #00ff00#%.2f"):format((t.text_color or "#WHITE#"), t.name:capitalize(), player.on_melee_hit[DamageType[t.type]]), w, h, 255, 255, 255, true)) h = h + self.font_h
+				local dval = player.on_melee_hit[DamageType[t.type]]
+				self:mouseTooltip(self.TOOLTIP_ON_HIT_DAMAGE, s:drawColorStringBlended(self.font, ("%s%-10s#LAST#: #00ff00#%.2f"):format((t.text_color or "#WHITE#"), t.name:capitalize(), (type(dval) == "number" and dval) or dval.dam), w, h, 255, 255, 255, true)) h = h + self.font_h
 			end
 		end
 
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

Post Reply