Pick up thrown items
This commit is contained in:
@@ -596,6 +596,17 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
|
||||
else
|
||||
_gameRepo.AnnounceMessageOnMainScreen($"Could not pick up {droppedItem.Item.ItemName}.");
|
||||
}
|
||||
if (area.GetParent() is ThrownItem thrownItem)
|
||||
{
|
||||
var isAdded = Inventory.TryAdd(thrownItem.ItemThatIsThrown);
|
||||
if (isAdded)
|
||||
{
|
||||
_gameRepo.AnnounceMessageOnMainScreen($"{thrownItem.ItemThatIsThrown.ItemName} picked up.");
|
||||
thrownItem.QueueFree();
|
||||
}
|
||||
else
|
||||
_gameRepo.AnnounceMessageOnMainScreen($"Could not pick up {thrownItem.ItemThatIsThrown.ItemName}.");
|
||||
}
|
||||
if (area.GetParent() is Restorative restorative)
|
||||
{
|
||||
_gameRepo.OnRestorativePickedUp(restorative);
|
||||
|
||||
Reference in New Issue
Block a user