From 13cc9501a79adc3b6f7788d1abca6613bcd0895d Mon Sep 17 00:00:00 2001 From: jgk Date: Mon, 8 Mar 2021 19:26:12 +0100 Subject: [PATCH] Improve inventory management, item pickup to cursor pos --- src/Dodge/CreatureActions.hs | 2 +- src/Dodge/Rendering.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Dodge/CreatureActions.hs b/src/Dodge/CreatureActions.hs index a68621e90..edeb2f2c1 100644 --- a/src/Dodge/CreatureActions.hs +++ b/src/Dodge/CreatureActions.hs @@ -322,7 +322,7 @@ pickUpItem' flit w = case maybeInvSlot of & creatures . ix 0 . crInv . ix i %~ addItem it where it = _flIt flit - maybeInvSlot = checkInvSlots it (_crInv (_creatures w IM.! 0)) + maybeInvSlot = checkInvSlotsYou it w updateItLocation invid w' = case _itID it of Nothing -> w' Just j -> w' & itemPositions . ix j .~ InInv 0 invid diff --git a/src/Dodge/Rendering.hs b/src/Dodge/Rendering.hs index 8bbb7e9a2..50f190670 100644 --- a/src/Dodge/Rendering.hs +++ b/src/Dodge/Rendering.hs @@ -82,7 +82,7 @@ activeObjectText w = case closestActiveObject w of theIt = _flIt flit itScreenPos = sc $ rotateV (0 - _cameraRot w) $ _cameraZoom w *.* (_flItPos flit -.- _cameraPos w) - freeSlot = checkInvSlots theIt $ _crInv $ you w + freeSlot = checkInvSlotsYou theIt w t = case freeSlot of Just i -> translate (pushout - halfWidth w) (halfHeight w - 20* (fromIntegral i +1)) Nothing -> translate (0.25*_windowX w) (0.25*_windowY w)