diff options
Diffstat (limited to 'scripts/Entities/Actions')
| -rw-r--r-- | scripts/Entities/Actions/DropAction.cs | 2 | ||||
| -rw-r--r-- | scripts/Entities/Actions/ItemAction.cs | 4 | ||||
| -rw-r--r-- | scripts/Entities/Actions/PickUpAction.cs | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/scripts/Entities/Actions/DropAction.cs b/scripts/Entities/Actions/DropAction.cs index 51d4ce6..920c04c 100644 --- a/scripts/Entities/Actions/DropAction.cs +++ b/scripts/Entities/Actions/DropAction.cs @@ -5,7 +5,7 @@ namespace TheLegendOfGustav.Entities.Actions; public partial class DropAction : ItemAction { - public DropAction(Player player, ConsumableItem item) : base(player, item) + public DropAction(Player player, Item item) : base(player, item) { } diff --git a/scripts/Entities/Actions/ItemAction.cs b/scripts/Entities/Actions/ItemAction.cs index a2ca1a2..a3197d4 100644 --- a/scripts/Entities/Actions/ItemAction.cs +++ b/scripts/Entities/Actions/ItemAction.cs @@ -5,9 +5,9 @@ namespace TheLegendOfGustav.Entities.Actions; public partial class ItemAction : Action { - protected ConsumableItem item; + protected Item item; - public ItemAction(Player player, ConsumableItem item) : base(player) + public ItemAction(Player player, Item item) : base(player) { this.item = item; Player = player; 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; |
