From 78e40d9fd55b6ba23db4f459e2c7e9ae2109cf5a Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 24 Oct 2016 21:52:20 -0400 Subject: Allowed items to be dropped --- gamemode/shared/inventory.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gamemode/shared/inventory.lua') diff --git a/gamemode/shared/inventory.lua b/gamemode/shared/inventory.lua index f83bb77..a8c1756 100644 --- a/gamemode/shared/inventory.lua +++ b/gamemode/shared/inventory.lua @@ -134,8 +134,14 @@ end -- @param item The item to give the player function pmeta:GiveItem(item) local x,y,b = self:FindSpotForItem(item) - self:PutInvItem(b,x,y,item) - self:SynchronizeInventory() + print("putting in ",x,y,b) + if x and y and b then + self:PutInvItem(b,x,y,item) + self:SynchronizeInventory() + return true + else + return false + end end --- Check if an item can fit in a position in a backpack @@ -196,7 +202,7 @@ end) -- @param fromcol The column to take the item from -- @param toslo The equipment slot to put the item into function pmeta:EquipItem(frombackpack, fromrow, fromcol, toslot) - local item = self.Inventory.Backpacks[frombackpack][1][fromrow[1]][fromcol[2]] + local item = self.Inventory.Backpacks[frombackpack][1][fromrow][fromcol] if item.Equipable ~= nil and item.Equipable == toslot then --Remove from the backpack for k = 1,#item.Shape do -- cgit v1.2.3-70-g09d2