Bug fixes & code cleanup for release

master
AlmTech Software 5 years ago
parent 6c93bff54c
commit b4d20fb3fa
  1. 22
      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,16 +32,18 @@ if CLIENT then
hook.Add( "PostDrawOpaqueRenderables", "Quantum_Client_DeveloperHands_HitPos", function()
if( LocalPlayer():IsSuperAdmin() && !Quantum.Client.IsInMenu ) then
if( LocalPlayer():GetActiveWeapon():GetClass() == "quantum_hands" ) then
local trace = LocalPlayer():GetEyeTrace()
local angle = trace.HitNormal:Angle()
render.SetMaterial( cubeMat )
render.DrawBox( trace.HitPos, Angle( 0, 0, 0), Vector( 0, 0, 0 ), Vector( 2, 2, 2 ), Color( 255, 25, 25, 100 ) )
render.DrawLine( trace.HitPos, trace.HitPos + 12 * angle:Forward(), Color( 255, 0, 0 ), true )
render.DrawLine( trace.HitPos, trace.HitPos + 12 * -angle:Right(), Color( 0, 255, 0 ), true )
render.DrawLine( trace.HitPos, trace.HitPos + 12 * angle:Up(), Color( 0, 0, 255 ), true )
if( IsValid( LocalPlayer():GetActiveWeapon() ) ) then
if( LocalPlayer():GetActiveWeapon():GetClass() == "quantum_hands" ) then
local trace = LocalPlayer():GetEyeTrace()
local angle = trace.HitNormal:Angle()
render.SetMaterial( cubeMat )
render.DrawBox( trace.HitPos, Angle( 0, 0, 0), Vector( 0, 0, 0 ), Vector( 2, 2, 2 ), Color( 255, 25, 25, 100 ) )
render.DrawLine( trace.HitPos, trace.HitPos + 12 * angle:Forward(), Color( 255, 0, 0 ), true )
render.DrawLine( trace.HitPos, trace.HitPos + 12 * -angle:Right(), Color( 0, 255, 0 ), true )
render.DrawLine( trace.HitPos, trace.HitPos + 12 * angle:Up(), Color( 0, 0, 255 ), true )
end
end
end
end)

@ -29,7 +29,7 @@ local function setUpPlayer( ply )
if( ply:GetModel() ~= nil ) then
ply:SetupHands()
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
local char = Quantum.Server.Char.GetCurrentCharacter( ply )
local charnametxt = " spawned."
@ -48,7 +48,7 @@ local function setUpPlayer( ply )
ply:Give( "quantum_hands" )
ply:SelectWeapon( "quantum_hands" )
Quantum.Debug( Quantum.PrintPlayer( pl ) .. charnametxt )
Quantum.Debug( Quantum.PrintPlayer( ply ) .. charnametxt )
end
function GM:PlayerSpawn( ply )

@ -51,10 +51,8 @@ if SERVER then -- server only functions
function Quantum.Effect.RemoveRuntimeFunction( pl, effectid, hookID )
hookID = hookID || "Quantum_Effects_RunTime_" .. tostring(pl:SteamID64()) .. "_" .. tostring(effectid)
--Quantum.Debug( "Removing runtime effect hook: " .. hookID )
if( pl.effecthooks != nil ) then
PrintTable( pl.effecthooks )
if( pl.effecthooks[hookID] != nil ) then
pl.effecthooks[hookID] = nil
end
@ -64,7 +62,7 @@ if SERVER then -- server only functions
function Quantum.Effect.RemoveAllRuntimeFunctions( pl )
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
Quantum.Effect.RemoveRuntimeFunction( pl, nil, hookid )
end
@ -93,7 +91,7 @@ if SERVER then -- server only functions
function Quantum.Effect.RemoveAll( pl )
local char = Quantum.Server.Char.GetCurrentCharacter( pl )
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
Quantum.Effect.Remove( pl, effect, char ) -- remove the effect
end
@ -107,7 +105,7 @@ if SERVER then -- server only functions
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
effectTbl.func.start( pl )

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