Nodes update & removed unused code

master
E. Almqvist 5 years ago
parent 7feda9f6a8
commit ba23e4d79a
  1. 10
      entities/entities/q_node/init.lua
  2. 61
      entities/weapons/quantum_tool/shared.lua
  3. 4
      gamemode/engine/lib/sh_node.lua
  4. 4
      gamemode/init.lua

@ -26,17 +26,15 @@ end
function ENT:OnTakeDamage( dmgInfo ) function ENT:OnTakeDamage( dmgInfo )
if( !self.m_bApplyingDamage ) then if( !self.m_bApplyingDamage ) then
local attacker = dmgInfo:GetAttacker()
local wep = attacker:GetActiveWeapon()
if( IsValid( wep ) && IsValid( attacker ) ) then
Quantum.Node.Gather( attacker, wep:GetClass(), self )
self:SetHealth( self:Health() - dmgInfo:GetDamage() ) self:SetHealth( self:Health() - dmgInfo:GetDamage() )
if( self:Health() <= 0 ) then if( self:Health() <= 0 ) then
Quantum.Node.Remove( self ) Quantum.Node.Remove( self )
end end
local attacker = dmgInfo:GetAttacker()
local wep = attacker:GetActiveWeapon()
if( IsValid( wep ) && IsValid( attacker ) ) then
Quantum.Node.Gather( attacker, wep:GetClass(), self )
end end
end end
end end

@ -1,61 +0,0 @@
-- __ _ _______ _ __
-- / / /\ | | |__ __| | | \ \
-- / / / \ | |_ __ ___ | | ___ ___| |__ \ \
-- < < / /\ \ | | '_ ` _ \| |/ _ \/ __| '_ \ > >
-- \ \ / ____ \| | | | | | | | __/ (__| | | | / /
-- \_\ /_/ \_\_|_| |_| |_|_|\___|\___|_| |_| /_/
AddCSLuaFile()
if CLIENT then
SWEP.PrintName = "Quantum Tool"
SWEP.Slot = 0
SWEP.SlotPos = 1
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = false
end
SWEP.WorldModel = "models/weapons/w_crowbar.mdl"
SWEP.ViewModel = "models/weapons/c_crowbar.mdl"
SWEP.UseHands = true
SWEP.Weight = 4
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = ""
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = ""
function SWEP:Initialize()
self:SetHoldType( "melee" )
end
function SWEP:Deploy()
if( CLIENT || !IsValid(self:GetOwner()) ) then return true end
self:GetOwner():DrawWorldModel( self.WorldModel != "" && self.WorldModel != nil )
return true
end
function SWEP:Holster()
return true
end
function SWEP:PreDrawViewModel()
return true
end
function SWEP:PrimaryAttack()
return
end
function SWEP:SecondaryAttack()
return
end
function SWEP:Reload()
return false
end

@ -103,10 +103,6 @@ if SERVER then
Quantum.Node.SpawnAllRegistered() Quantum.Node.SpawnAllRegistered()
end end
if( #player.GetAll() > 0 ) then
Quantum.Node.UpdateAll() -- update all nodes on lua refresh
end
hook.Add( "PlayerInitialSpawn", "Quantum_Init_Nodes_Load", function() hook.Add( "PlayerInitialSpawn", "Quantum_Init_Nodes_Load", function()
Quantum.Debug( "Spawning registered nodes..." ) Quantum.Debug( "Spawning registered nodes..." )

@ -160,6 +160,10 @@ if SERVER then
Quantum.Server.Loaded = true Quantum.Server.Loaded = true
if( #player.GetAll() > 0 ) then
Quantum.Node.UpdateAll() -- update all nodes on lua refresh
end
end end
Quantum.Server.Load() Quantum.Server.Load()

Loading…
Cancel
Save