Improve item location code
This commit is contained in:
@@ -16,10 +16,11 @@ import ShapePicture
|
||||
|
||||
itemEquipPict :: Creature -> Item -> SPic
|
||||
itemEquipPict cr it = case it ^. itUse of
|
||||
HeldUse{} | _itIsRoot it -> overPosSP (heldItemOffset it cr) (itemSPic it)
|
||||
HeldUse{} | it ^? itLocation . ilIsRoot == Just True
|
||||
-> overPosSP (heldItemOffset it cr) (itemSPic it)
|
||||
ituse -> fromMaybe mempty $ do
|
||||
attachpos <- ituse ^? equipEffect . eeAttachPos
|
||||
i <- it ^? itLocation . ipInvID
|
||||
i <- it ^? itLocation . ilInvID
|
||||
epos <- cr ^? crInvEquipped . ix i
|
||||
return $ equipPosition epos cr attachpos (itemSPic it)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user