Bug fixes & code cleanup for release

master
AlmTech Software 5 years ago
parent 6c93bff54c
commit b4d20fb3fa
  1. 2
      entities/weapons/quantum_hands/shared.lua
  2. 4
      gamemode/engine/core/server/sv_player_init.lua
  3. 8
      gamemode/engine/lib/sh_effects.lua
  4. 2
      gamemode/engine/vars/sh_vars.lua

@ -32,6 +32,7 @@ if CLIENT then
hook.Add( "PostDrawOpaqueRenderables", "Quantum_Client_DeveloperHands_HitPos", function() hook.Add( "PostDrawOpaqueRenderables", "Quantum_Client_DeveloperHands_HitPos", function()
if( LocalPlayer():IsSuperAdmin() && !Quantum.Client.IsInMenu ) then if( LocalPlayer():IsSuperAdmin() && !Quantum.Client.IsInMenu ) then
if( IsValid( LocalPlayer():GetActiveWeapon() ) ) then
if( LocalPlayer():GetActiveWeapon():GetClass() == "quantum_hands" ) then if( LocalPlayer():GetActiveWeapon():GetClass() == "quantum_hands" ) then
local trace = LocalPlayer():GetEyeTrace() local trace = LocalPlayer():GetEyeTrace()
local angle = trace.HitNormal:Angle() local angle = trace.HitNormal:Angle()
@ -44,6 +45,7 @@ if CLIENT then
render.DrawLine( trace.HitPos, trace.HitPos + 12 * angle:Up(), Color( 0, 0, 255 ), true ) render.DrawLine( trace.HitPos, trace.HitPos + 12 * angle:Up(), Color( 0, 0, 255 ), true )
end end
end end
end
end) end)
end end

@ -29,7 +29,7 @@ local function setUpPlayer( ply )
if( ply:GetModel() ~= nil ) then if( ply:GetModel() ~= nil ) then
ply:SetupHands() ply:SetupHands()
else else
Quantum.Error( tostring(ply) .. " doesn't have a valid model. Unable to set up hands!" ) Quantum.Error( Quantum.PrintPlayer( ply ) .. " doesn't have a valid model. Unable to set up hands!" )
end end
local char = Quantum.Server.Char.GetCurrentCharacter( ply ) local char = Quantum.Server.Char.GetCurrentCharacter( ply )
local charnametxt = " spawned." local charnametxt = " spawned."
@ -48,7 +48,7 @@ local function setUpPlayer( ply )
ply:Give( "quantum_hands" ) ply:Give( "quantum_hands" )
ply:SelectWeapon( "quantum_hands" ) ply:SelectWeapon( "quantum_hands" )
Quantum.Debug( Quantum.PrintPlayer( pl ) .. charnametxt ) Quantum.Debug( Quantum.PrintPlayer( ply ) .. charnametxt )
end end
function GM:PlayerSpawn( ply ) function GM:PlayerSpawn( ply )

@ -51,10 +51,8 @@ if SERVER then -- server only functions
function Quantum.Effect.RemoveRuntimeFunction( pl, effectid, hookID ) function Quantum.Effect.RemoveRuntimeFunction( pl, effectid, hookID )
hookID = hookID || "Quantum_Effects_RunTime_" .. tostring(pl:SteamID64()) .. "_" .. tostring(effectid) hookID = hookID || "Quantum_Effects_RunTime_" .. tostring(pl:SteamID64()) .. "_" .. tostring(effectid)
--Quantum.Debug( "Removing runtime effect hook: " .. hookID )
if( pl.effecthooks != nil ) then if( pl.effecthooks != nil ) then
PrintTable( pl.effecthooks )
if( pl.effecthooks[hookID] != nil ) then if( pl.effecthooks[hookID] != nil ) then
pl.effecthooks[hookID] = nil pl.effecthooks[hookID] = nil
end end
@ -64,7 +62,7 @@ if SERVER then -- server only functions
function Quantum.Effect.RemoveAllRuntimeFunctions( pl ) function Quantum.Effect.RemoveAllRuntimeFunctions( pl )
if( pl.effecthooks != nil ) then if( pl.effecthooks != nil ) then
Quantum.Debug( "Removing all runtime hooks for " .. tostring(pl) .. "." ) Quantum.Debug( "Removing all runtime hooks for " .. Quantum.PrintPlayer( pl ) .. "." )
for n, hookid in pairs( pl.effecthooks ) do for n, hookid in pairs( pl.effecthooks ) do
Quantum.Effect.RemoveRuntimeFunction( pl, nil, hookid ) Quantum.Effect.RemoveRuntimeFunction( pl, nil, hookid )
end end
@ -93,7 +91,7 @@ if SERVER then -- server only functions
function Quantum.Effect.RemoveAll( pl ) function Quantum.Effect.RemoveAll( pl )
local char = Quantum.Server.Char.GetCurrentCharacter( pl ) local char = Quantum.Server.Char.GetCurrentCharacter( pl )
if( char.effects != nil ) then if( char.effects != nil ) then
Quantum.Debug( "Removing all " .. tostring(pl) .. " effects." ) Quantum.Debug( "Removing all " .. Quantum.PrintPlayer( pl ) .. " effects." )
for i, effect in pairs( char.effects ) do for i, effect in pairs( char.effects ) do
Quantum.Effect.Remove( pl, effect, char ) -- remove the effect Quantum.Effect.Remove( pl, effect, char ) -- remove the effect
end end
@ -107,7 +105,7 @@ if SERVER then -- server only functions
if( effectTbl != nil ) then if( effectTbl != nil ) then
Quantum.Debug( "Giving " .. tostring(pl) .. " the '" .. tostring(effectid) .. "' effect." ) Quantum.Debug( "Giving " .. Quantum.PrintPlayer( pl ) .. " the '" .. tostring(effectid) .. "' effect." )
if( effectTbl.func.start != nil && effectTbl.func.start != Quantum.EmptyFunction ) then if( effectTbl.func.start != nil && effectTbl.func.start != Quantum.EmptyFunction ) then
effectTbl.func.start( pl ) effectTbl.func.start( pl )

@ -54,5 +54,5 @@ function Quantum.WriteIntcode( intcode )
end end
function Quantum.PrintPlayer( pl ) function Quantum.PrintPlayer( pl )
return pl:Nick() .. " | " .. pl:SteamID() return "[" .. pl:Nick() .. "|" .. pl:SteamID() .. "]"
end end
Loading…
Cancel
Save