Skip to content

Commit

Permalink
#6: Fix item drop location issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Danil Ko committed Mar 7, 2021
1 parent 2e575b3 commit 1bc4a88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions inventory/InventoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ItemResource GetPurchasableItemByID(String itemID)
}

// Add item through unit cost in team
public void BuyItem(ItemResource itemResource, Inventory inventory)
public void PurchaseItem(ItemResource itemResource, Inventory inventory)
{
if (inventory != null && itemResource != null && IsInstanceValid(inventory) && IsInstanceValid(itemResource))
{
Expand Down Expand Up @@ -263,8 +263,11 @@ private void _clientCreatePickUp(String info)
infoIndex++;

float positionX = float.Parse(splitInfo[infoIndex]);
float positionY = float.Parse(splitInfo[infoIndex]);
infoIndex++;

float positionY = float.Parse(splitInfo[infoIndex]);
infoIndex++;

_createPickUp(itemResource, new Vector2(positionX, positionY));
}
}
Expand Down
2 changes: 1 addition & 1 deletion ui/InventoryUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private void _populateGridContainer(GridContainer gridContainer)

private void _purchaseItem(ItemResource itemResource)
{
_inventoryManager.BuyItem(itemResource, _inventory);
_inventoryManager.PurchaseItem(itemResource, _inventory);
}

private void _sellItem(int inventoryIndex)
Expand Down

0 comments on commit 1bc4a88

Please sign in to comment.