Cleanup, fix broken records in LeftUse

This commit is contained in:
2024-10-03 10:34:17 +01:00
parent e88b3c7443
commit 1953fb2d0c
19 changed files with 71 additions and 114 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ updateRBList w
EquipOptions{} -> w
_ -> fromMaybe (w & rbOptions .~ NoRightButtonOptions) $ do
i <- cr ^? crManipulation . manObject . imSelectedItem
esite <- cr ^? crInv . ix i . itUse . equipEffect . eeSite
esite <- cr ^? crInv . ix i . itUse . uequipEffect . eeSite
return $
w
& rbOptions
@@ -47,7 +47,7 @@ chooseFreeSite cr = fromMaybe 0 . findIndex hasnoequipment
getEquipmentAllocation :: World -> EquipmentAllocation
getEquipmentAllocation w = fromMaybe DoNotMoveEquipment $ do
curpos <- you w ^? crManipulation . manObject . imSelectedItem
esite <- you w ^? crInv . ix curpos . itUse . equipEffect . eeSite
esite <- you w ^? crInv . ix curpos . itUse . uequipEffect . eeSite
i <- w ^? rbOptions . opSel
<|> Just (chooseEquipmentPosition (you w) (equipSiteToPositions esite))
es <- equipSiteToPositions esite ^? ix i