diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-10-24 21:52:20 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-10-24 21:52:20 -0400 |
| commit | 78e40d9fd55b6ba23db4f459e2c7e9ae2109cf5a (patch) | |
| tree | 3c87a74fb2c6a792a93c7f242d9e92e478f4f77a /gamemode/shared/inventory.lua | |
| parent | 9ae67530dc4be9eaab7b1243330e810d1d5a6fee (diff) | |
| download | artery-78e40d9fd55b6ba23db4f459e2c7e9ae2109cf5a.tar.gz artery-78e40d9fd55b6ba23db4f459e2c7e9ae2109cf5a.tar.bz2 artery-78e40d9fd55b6ba23db4f459e2c7e9ae2109cf5a.zip | |
Allowed items to be dropped
Diffstat (limited to 'gamemode/shared/inventory.lua')
| -rw-r--r-- | gamemode/shared/inventory.lua | 12 |
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 |
