Remove useless SetTeamID functions.
This commit is contained in:
parent
6467ed8dbd
commit
db061a1ec3
12 changed files with 12 additions and 26 deletions
|
@ -1,10 +1,8 @@
|
||||||
ENT.Base = "logic_points"
|
ENT.Base = "logic_points"
|
||||||
ENT.Type = "point"
|
ENT.Type = "point"
|
||||||
|
|
||||||
ENT.ValidTeam = TEAM_UNDEAD
|
|
||||||
|
|
||||||
function ENT:Add(pl, amount)
|
function ENT:Add(pl, amount)
|
||||||
if pl and pl:IsValid() and pl:IsPlayer() and pl:Team() == self.ValidTeam then
|
if pl and pl:IsValid() and pl:IsPlayer() and pl:Team() == TEAM_UNDEAD then
|
||||||
amount = math.Round(amount)
|
amount = math.Round(amount)
|
||||||
if amount < 0 then
|
if amount < 0 then
|
||||||
pl:TakeBrains(-amount)
|
pl:TakeBrains(-amount)
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
ENT.Type = "point"
|
ENT.Type = "point"
|
||||||
|
|
||||||
ENT.ValidTeam = TEAM_HUMAN
|
|
||||||
|
|
||||||
function ENT:Add(pl, amount)
|
function ENT:Add(pl, amount)
|
||||||
if pl and pl:IsValid() and pl:IsPlayer() and pl:Team() == self.ValidTeam then
|
if pl and pl:IsValid() and pl:IsPlayer() and pl:Team() == TEAM_HUMAN then
|
||||||
amount = math.Round(amount)
|
amount = math.Round(amount)
|
||||||
if amount < 0 then
|
if amount < 0 then
|
||||||
pl:TakePoints(-amount)
|
pl:TakePoints(-amount)
|
||||||
|
@ -14,7 +12,7 @@ function ENT:Add(pl, amount)
|
||||||
end
|
end
|
||||||
|
|
||||||
function ENT:Set(pl, amount)
|
function ENT:Set(pl, amount)
|
||||||
if pl and pl:IsValid() and pl:IsPlayer() and pl:Team() == self.ValidTeam then
|
if pl and pl:IsValid() and pl:IsPlayer() and pl:Team() == TEAM_HUMAN then
|
||||||
self:SetAmount(pl, amount)
|
self:SetAmount(pl, amount)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -29,13 +27,13 @@ end
|
||||||
|
|
||||||
function ENT:CallIf(pl, amount)
|
function ENT:CallIf(pl, amount)
|
||||||
if pl and pl:IsValid() and pl:IsPlayer() then
|
if pl and pl:IsValid() and pl:IsPlayer() then
|
||||||
self:Input(pl:Team() == self.ValidTeam and self:GetAmount(pl) >= amount and "onconditionpassed" or "onconditionfailed", pl, self, amount)
|
self:Input(pl:Team() == TEAM_HUMAN and self:GetAmount(pl) >= amount and "onconditionpassed" or "onconditionfailed", pl, self, amount)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ENT:CallIfNot(pl, amount)
|
function ENT:CallIfNot(pl, amount)
|
||||||
if pl and pl:IsValid() and pl:IsPlayer() then
|
if pl and pl:IsValid() and pl:IsPlayer() then
|
||||||
self:Input(pl:Team() == self.ValidTeam and self:GetAmount(pl) >= amount and "onconditionfailed" or "onconditionpassed", pl, self, amount)
|
self:Input(pl:Team() == TEAM_HUMAN and self:GetAmount(pl) >= amount and "onconditionfailed" or "onconditionpassed", pl, self, amount)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ local function DoFleshThrow(pl, wep)
|
||||||
ent:SetAngles(AngleRand())
|
ent:SetAngles(AngleRand())
|
||||||
ent:SetOwner(pl)
|
ent:SetOwner(pl)
|
||||||
ent:Spawn()
|
ent:Spawn()
|
||||||
ent:SetTeamID(TEAM_UNDEAD)
|
|
||||||
local phys = ent:GetPhysicsObject()
|
local phys = ent:GetPhysicsObject()
|
||||||
if phys:IsValid() then
|
if phys:IsValid() then
|
||||||
phys:SetVelocityInstantaneous(heading * 800)
|
phys:SetVelocityInstantaneous(heading * 800)
|
||||||
|
|
|
@ -51,7 +51,7 @@ local function DoFleshThrow(pl, wep)
|
||||||
ent:SetPos(startpos)
|
ent:SetPos(startpos)
|
||||||
ent:SetOwner(pl)
|
ent:SetOwner(pl)
|
||||||
ent:Spawn()
|
ent:Spawn()
|
||||||
ent:SetTeamID(TEAM_UNDEAD)
|
|
||||||
local phys = ent:GetPhysicsObject()
|
local phys = ent:GetPhysicsObject()
|
||||||
if phys:IsValid() then
|
if phys:IsValid() then
|
||||||
phys:SetVelocityInstantaneous(ang:Forward() * math.Rand(320, 380))
|
phys:SetVelocityInstantaneous(ang:Forward() * math.Rand(320, 380))
|
||||||
|
|
|
@ -26,7 +26,7 @@ local function DoFleshThrow(pl, wep)
|
||||||
ent:SetPos(startpos + heading * 8)
|
ent:SetPos(startpos + heading * 8)
|
||||||
ent:SetOwner(pl)
|
ent:SetOwner(pl)
|
||||||
ent:Spawn()
|
ent:Spawn()
|
||||||
ent:SetTeamID(TEAM_UNDEAD)
|
|
||||||
local phys = ent:GetPhysicsObject()
|
local phys = ent:GetPhysicsObject()
|
||||||
if phys:IsValid() then
|
if phys:IsValid() then
|
||||||
phys:SetVelocityInstantaneous(heading * math.Rand(340, 550))
|
phys:SetVelocityInstantaneous(heading * math.Rand(340, 550))
|
||||||
|
|
|
@ -52,8 +52,6 @@ function SWEP:Think()
|
||||||
ent:SetOwner(pl)
|
ent:SetOwner(pl)
|
||||||
ent:Spawn()
|
ent:Spawn()
|
||||||
|
|
||||||
ent:SetTeamID(TEAM_UNDEAD)
|
|
||||||
|
|
||||||
local phys = ent:GetPhysicsObject()
|
local phys = ent:GetPhysicsObject()
|
||||||
if phys:IsValid() then
|
if phys:IsValid() then
|
||||||
local ang = pl:EyeAngles()
|
local ang = pl:EyeAngles()
|
||||||
|
|
|
@ -20,6 +20,7 @@ include("vgui/dteamcounter.lua")
|
||||||
include("vgui/dmodelpanelex.lua")
|
include("vgui/dmodelpanelex.lua")
|
||||||
include("vgui/dammocounter.lua")
|
include("vgui/dammocounter.lua")
|
||||||
include("vgui/dteamheading.lua")
|
include("vgui/dteamheading.lua")
|
||||||
|
include("vgui/dmodelkillicon.lua")
|
||||||
|
|
||||||
include("vgui/dexroundedpanel.lua")
|
include("vgui/dexroundedpanel.lua")
|
||||||
include("vgui/dexroundedframe.lua")
|
include("vgui/dexroundedframe.lua")
|
||||||
|
|
|
@ -70,6 +70,7 @@ AddCSLuaFile("vgui/dammocounter.lua")
|
||||||
AddCSLuaFile("vgui/dpingmeter.lua")
|
AddCSLuaFile("vgui/dpingmeter.lua")
|
||||||
AddCSLuaFile("vgui/dteamheading.lua")
|
AddCSLuaFile("vgui/dteamheading.lua")
|
||||||
AddCSLuaFile("vgui/dsidemenu.lua")
|
AddCSLuaFile("vgui/dsidemenu.lua")
|
||||||
|
AddCSLuaFile("vgui/dmodelkillicon.lua")
|
||||||
|
|
||||||
AddCSLuaFile("vgui/dexroundedpanel.lua")
|
AddCSLuaFile("vgui/dexroundedpanel.lua")
|
||||||
AddCSLuaFile("vgui/dexroundedframe.lua")
|
AddCSLuaFile("vgui/dexroundedframe.lua")
|
||||||
|
|
|
@ -75,14 +75,6 @@ function meta:ResetBones(onlyscale)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function meta:SetTeamID(teamid)
|
|
||||||
self.TeamID = teamid
|
|
||||||
end
|
|
||||||
|
|
||||||
function meta:GetTeamID()
|
|
||||||
return self.Team and self:Team() or self.TeamID or 0
|
|
||||||
end
|
|
||||||
|
|
||||||
function meta:SetBarricadeHealth(m)
|
function meta:SetBarricadeHealth(m)
|
||||||
self:SetDTFloat(1, m)
|
self:SetDTFloat(1, m)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
local meta = FindMetaTable("Player")
|
local meta = FindMetaTable("Player")
|
||||||
if not meta then return end
|
if not meta then return end
|
||||||
|
|
||||||
meta.GetTeamID = meta.Team
|
|
||||||
|
|
||||||
function meta:GetMaxHealthEx()
|
function meta:GetMaxHealthEx()
|
||||||
if self:Team() == TEAM_UNDEAD then
|
if self:Team() == TEAM_UNDEAD then
|
||||||
return self:GetMaxZombieHealth()
|
return self:GetMaxZombieHealth()
|
||||||
|
|
|
@ -166,7 +166,7 @@ if SERVER then
|
||||||
ent:SetPos(pos)
|
ent:SetPos(pos)
|
||||||
ent:SetOwner(pl)
|
ent:SetOwner(pl)
|
||||||
ent:Spawn()
|
ent:Spawn()
|
||||||
ent:SetTeamID(TEAM_UNDEAD)
|
|
||||||
local phys = ent:GetPhysicsObject()
|
local phys = ent:GetPhysicsObject()
|
||||||
if phys:IsValid() then
|
if phys:IsValid() then
|
||||||
phys:Wake()
|
phys:Wake()
|
||||||
|
|
|
@ -149,7 +149,7 @@ end
|
||||||
ent:SetPos(damagepos + heading)
|
ent:SetPos(damagepos + heading)
|
||||||
ent:SetOwner(pl)
|
ent:SetOwner(pl)
|
||||||
ent:Spawn()
|
ent:Spawn()
|
||||||
ent:SetTeamID(TEAM_UNDEAD)
|
|
||||||
local phys = ent:GetPhysicsObject()
|
local phys = ent:GetPhysicsObject()
|
||||||
if phys:IsValid() then
|
if phys:IsValid() then
|
||||||
phys:Wake()
|
phys:Wake()
|
||||||
|
|
Loading…
Reference in a new issue