summaryrefslogtreecommitdiff
path: root/scripts/Entities/Actions/PickUpAction.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Entities/Actions/PickUpAction.cs')
-rw-r--r--scripts/Entities/Actions/PickUpAction.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/Entities/Actions/PickUpAction.cs b/scripts/Entities/Actions/PickUpAction.cs
index eaed01c..7676294 100644
--- a/scripts/Entities/Actions/PickUpAction.cs
+++ b/scripts/Entities/Actions/PickUpAction.cs
@@ -19,7 +19,7 @@ public partial class PickupAction : DirectionalAction
public override bool Perform()
{
- ConsumableItem item = MapData.GetFirstItemAtPosition(Destination);
+ ItemEntity item = MapData.GetFirstItemAtPosition(Destination);
if (item == null)
{
@@ -34,7 +34,9 @@ public partial class PickupAction : DirectionalAction
}
MapData.RemoveEntity(item);
- player.Inventory.Add(item);
+ player.Inventory.Add(item.Item);
+
+ item.QueueFree();
player.Energy -= cost;
return true;