diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-10-24 21:25:15 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-10-24 21:25:15 -0300 |
| commit | 639cd8cef403e9e66bf31e7888e786effac2b292 (patch) | |
| tree | a1b3872a91ad599a71629d0d62c72125138c5c14 /scripts/Entities/Actions/PickUpAction.cs | |
| parent | 52c32a24044aa574c9e7bf7aa4e2499349cc36b2 (diff) | |
refactor: Sistema de itens reescrito
Em tese, este novo sistema é mais fácil de serializar.
Descanse em paz pergaminhos, eu não quero reimplementá-los
neste novo sistema.
Diffstat (limited to 'scripts/Entities/Actions/PickUpAction.cs')
| -rw-r--r-- | scripts/Entities/Actions/PickUpAction.cs | 6 |
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; |
