diff options
Diffstat (limited to 'users/grfn/xanthous/src/Xanthous/Entities/Character.hs')
-rw-r--r-- | users/grfn/xanthous/src/Xanthous/Entities/Character.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/users/grfn/xanthous/src/Xanthous/Entities/Character.hs b/users/grfn/xanthous/src/Xanthous/Entities/Character.hs index 0a993a2f479c..c8153086f1ac 100644 --- a/users/grfn/xanthous/src/Xanthous/Entities/Character.hs +++ b/users/grfn/xanthous/src/Xanthous/Entities/Character.hs @@ -218,7 +218,9 @@ defaultCharacterDamage = 1 characterDamage :: Character -> Hitpoints characterDamage = fromMaybe defaultCharacterDamage - . preview (inventory . wielded . wieldedItems . wieldableItem . Raw.damage) + . filter (/= 0) + . Just + . sumOf (inventory . wielded . wieldedItems . wieldableItem . Raw.damage) -- | Is the character fully healed up to or past their initial hitpoints? isFullyHealed :: Character -> Bool |