From c5bfa36bdec169f4dd643db6977d76fd2dbd482f Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 23 Feb 2023 14:35:17 +0000 Subject: [PATCH] Fix wristArmour drop bug --- src/Dodge/Euse.hs | 6 ++++-- src/Dodge/Render/HUD.hs | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Dodge/Euse.hs b/src/Dodge/Euse.hs index fc1d56543..9a88df66b 100644 --- a/src/Dodge/Euse.hs +++ b/src/Dodge/Euse.hs @@ -80,9 +80,11 @@ onEquipWristShield itm cr w = onRemoveWristShield :: Item -> Creature -> World -> World onRemoveWristShield itm _ = - (pointerToItem itm . itUse . equipEffect . eeParams .~ NoEquipParams) . deleteWallID i + (pointerToItem itm . itUse . equipEffect . eeParams .~ NoEquipParams) . mremovewall where - i = _eparamID $ _eeParams $ _equipEffect $ _itUse itm + mremovewall = fromMaybe id $ do + i <- itm ^? itUse . equipEffect . eeParams . eparamID + return $ deleteWallID i setWristShieldPos :: Item -> Creature -> World -> World setWristShieldPos itm cr w = diff --git a/src/Dodge/Render/HUD.hs b/src/Dodge/Render/HUD.hs index bafb8a84d..2b7c4cc4c 100644 --- a/src/Dodge/Render/HUD.hs +++ b/src/Dodge/Render/HUD.hs @@ -134,7 +134,8 @@ drawNoSubInventory cfig w = invid <- cr ^. crLeftInvSel . lisMPos sss <- w ^? hud . hudElement . diSections pos <- selSecSelPos 0 invid sss - return $ listTextPictureAt 144 0 cfig pos . color cyan . text . eqPosText $_crInvEquipped cr IM.! invid + return $ listTextPictureAt 144 0 cfig pos . color cyan . text . eqPosText + $ _crInvEquipped cr IM.! invid f col invid epos = fromMaybe mempty $ do sss <- w ^? hud . hudElement . diSections pos <- selSecSelPos 0 invid sss