From 9496a48d4a5e63af2aebb6a9603b56eba9bd2377 Mon Sep 17 00:00:00 2001 From: AlmTech Software Date: Sun, 5 Jan 2020 20:28:08 +0100 Subject: [PATCH] Item equip progress --- gamemode/engine/lib/server/sv_inventory.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gamemode/engine/lib/server/sv_inventory.lua b/gamemode/engine/lib/server/sv_inventory.lua index d40ba70..a9e27f6 100644 --- a/gamemode/engine/lib/server/sv_inventory.lua +++ b/gamemode/engine/lib/server/sv_inventory.lua @@ -40,10 +40,16 @@ function Quantum.Server.Inventory.EquipItem( pl, itemindex ) local equipslot = itemTbl.equipslot if( equipslot == nil ) then - Quantum.Error( tostring(pl) .. " tried to equip an non-equipable item (" .. tostring(itemTbl[1]) .. ")" ) + Quantum.Error( tostring(pl) .. " tried to equip an non-equipable item: (" .. tostring(itemTbl[1]) .. ")" ) return else - + if( Quantum.EquipSlots[equipslot] != nil ) then + char.equiped[equipslot] = slotitem[1] -- set it in the table + + else + Quantum.Error( tostring(pl) .. " tried to equip an item in a non-existent equip slot: (" .. tostring(equipslot) .. ")" ) + return + end end end end