Fixed item effects bug & max health bug

master
AlmTech Software 5 years ago
parent 7595e15d7e
commit 222b8a1467
  1. 4
      gamemode/engine/derma/menus/menu_crafting.lua
  2. 2
      gamemode/engine/derma/menus/menu_main.lua
  3. 18
      gamemode/engine/lib/sh_effects.lua

@ -150,6 +150,10 @@ function menu.open( dt )
end end
end end
if( recipes == nil ) then
return
end
local items = Quantum.Client.Inventory local items = Quantum.Client.Inventory
local equipped = Quantum.Client.Equipped local equipped = Quantum.Client.Equipped

@ -78,7 +78,7 @@ function main.open(dt)
surface.SetFont( buttonFont ) surface.SetFont( buttonFont )
local x, buttonHeight = surface.GetTextSize( "AAAAA" ) local x, buttonHeight = surface.GetTextSize( "AAAAA" )
buttonHeight = buttonHeight + padding buttonHeight = buttonHeight + padding/2
x = nil x = nil
local f = vgui.Create( "DFrame" ) local f = vgui.Create( "DFrame" )

@ -129,4 +129,22 @@ if SERVER then -- server only functions
Quantum.Effect.RemoveAll( ply ) -- remove all effects Quantum.Effect.RemoveAll( ply ) -- remove all effects
end) end)
hook.Add( "PlayerSpawn", "Quantum_Effects_GiveEquippedEffects", function( ply )
local char = Quantum.Server.Char.GetCurrentCharacter( ply )
if( char != nil ) then
local equippedItems = Quantum.Server.Inventory.GetEquippedItems( ply, char ) -- add all of the effects given by equipped items
local slotItemID
local itemTbl
for i, tbl in pairs( equippedItems ) do
slotItemID = Quantum.Server.Inventory.GetSlotItem( char, tbl.slot )[1]
itemTbl = Quantum.Item.Get( slotItemID )
if( itemTbl.equipeffect != nil ) then
print("GIVE")
Quantum.Effect.Give( ply, itemTbl.equipeffect )
end
end
end
end)
end end
Loading…
Cancel
Save