From bc0a0d487283a3203ea9cee2d52d8ea4503aa665 Mon Sep 17 00:00:00 2001 From: AlmTech Software Date: Mon, 13 Jan 2020 19:17:40 +0100 Subject: [PATCH] Fixed notify bug --- gamemode/engine/lib/server/sv_crafting.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gamemode/engine/lib/server/sv_crafting.lua b/gamemode/engine/lib/server/sv_crafting.lua index f6c4803..6d41caf 100644 --- a/gamemode/engine/lib/server/sv_crafting.lua +++ b/gamemode/engine/lib/server/sv_crafting.lua @@ -22,18 +22,20 @@ local function cancelCrafting( pl ) end function Quantum.Server.Crafting.MakeItem( pl, itemid ) + local recipe = Quantum.Recipe.Get( itemid ) local char = Quantum.Server.Char.GetCurrentCharacter( pl ) local inv = Quantum.Server.Char.GetInventory( char ) if( recipe != nil ) then + local canMake, failedReq = Quantum.Recipe.CanMake( inv, itemid ) if( canMake ) then cancelCrafting( pl ) -- stop the crafting if the player is allready crafting something + -- and then craft this item instead - setPlayerIsCrafting( pl, true ) timer.Create( "Quantum_Crafting_" .. pl:SteamID64(), recipe.delay, 1, function() @@ -49,7 +51,7 @@ function Quantum.Server.Crafting.MakeItem( pl, itemid ) else -- Dont make the item - Quantum.Notify.Deny( pl, "You don't have sufficient resources to create that item!" ) + Quantum.Notify.Deny( pl, "You don not have sufficient resources to create that item!" ) end end