Character sheet shows incorrect melee data when disarmed

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

Character sheet shows incorrect melee data when disarmed

#1 Post by Hachem_Muche »

When disarmed, the Attack tab of the character sheet incorrectly shows the normal attack information. While disarmed, however, you are treated as being unarmed for purposes of determining melee damage and your offhand weapon is disabled.

Patch to correct this:

Code: Select all

 game/modules/tome/dialogs/CharacterSheet.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/game/modules/tome/dialogs/CharacterSheet.lua b/game/modules/tome/dialogs/CharacterSheet.lua
index 275f977..f7c9b19 100644
--- a/game/modules/tome/dialogs/CharacterSheet.lua
+++ b/game/modules/tome/dialogs/CharacterSheet.lua
@@ -553,7 +553,7 @@ function _M:drawDialog(kind, actor_to_compare)
 		w = 0
 
 		local mainhand = player:getInven(player.INVEN_MAINHAND)
-		if mainhand and (#mainhand > 0) then
+		if mainhand and (#mainhand > 0) and not player:attr("disarmed") then
 			local WeaponTxt = "#LIGHT_BLUE#Main Hand"
 			if player:hasTwoHandedWeapon() then
 				WeaponTxt = WeaponTxt.."(2-handed)"
@@ -616,7 +616,7 @@ function _M:drawDialog(kind, actor_to_compare)
 					dam = (player:getInven("QUIVER") and player:getInven("QUIVER")[1] and player:getInven("QUIVER")[1].combat)
 				end
 				if mean and dam then
-					s:drawColorStringBlended(self.font, "#LIGHT_BLUE#Off Hand:", w, h, 255, 255, 255, true) h = h + self.font_h
+					s:drawColorStringBlended(self.font, "#LIGHT_BLUE#Off Hand:"..(player:attr("disarmed") and " (disabled)" or ""), w, h, 255, 255, 255, true) h = h + self.font_h
 					text = compare_fields(player, actor_to_compare, function(actor, ...) return math.floor(actor:combatAttack(...)) end, "%3d", "%+.0f", 1, false, false, mean)
 					dur_text = ("%d"):format(math.floor(player:combatAttack(o.combat)/5))
 					self:mouseTooltip(self.TOOLTIP_COMBAT_ATTACK, s:drawColorStringBlended(self.font, ("Accuracy    : #00ff00#%s"):format(text), w, h, 255, 255, 255, true)) h = h + self.font_h
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

Post Reply