From 639cd8cef403e9e66bf31e7888e786effac2b292 Mon Sep 17 00:00:00 2001 From: Matheus Date: Fri, 24 Oct 2025 21:25:15 -0300 Subject: refactor: Sistema de itens reescrito MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Em tese, este novo sistema é mais fácil de serializar. Descanse em paz pergaminhos, eu não quero reimplementá-los neste novo sistema. --- scripts/Entities/Actions/PickUpAction.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/Entities/Actions/PickUpAction.cs') 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; -- cgit v1.2.3