aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/inventory.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/shared/inventory.lua')
-rw-r--r--gamemode/shared/inventory.lua12
1 files changed, 9 insertions, 3 deletions
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