Remove useless SetTeamID functions.

This commit is contained in:
JetBoom 2014-12-07 15:02:40 -05:00
parent 6467ed8dbd
commit db061a1ec3
12 changed files with 12 additions and 26 deletions

View file

@ -1,10 +1,8 @@
ENT.Base = "logic_points"
ENT.Type = "point"
ENT.ValidTeam = TEAM_UNDEAD
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)
if amount < 0 then
pl:TakeBrains(-amount)

View file

@ -1,9 +1,7 @@
ENT.Type = "point"
ENT.ValidTeam = TEAM_HUMAN
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)
if amount < 0 then
pl:TakePoints(-amount)
@ -14,7 +12,7 @@ function ENT:Add(pl, amount)
end
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)
end
end
@ -29,13 +27,13 @@ end
function ENT:CallIf(pl, amount)
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
function ENT:CallIfNot(pl, amount)
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

View file

@ -21,7 +21,7 @@ local function DoFleshThrow(pl, wep)
ent:SetAngles(AngleRand())
ent:SetOwner(pl)
ent:Spawn()
ent:SetTeamID(TEAM_UNDEAD)
local phys = ent:GetPhysicsObject()
if phys:IsValid() then
phys:SetVelocityInstantaneous(heading * 800)

View file

@ -51,7 +51,7 @@ local function DoFleshThrow(pl, wep)
ent:SetPos(startpos)
ent:SetOwner(pl)
ent:Spawn()
ent:SetTeamID(TEAM_UNDEAD)
local phys = ent:GetPhysicsObject()
if phys:IsValid() then
phys:SetVelocityInstantaneous(ang:Forward() * math.Rand(320, 380))

View file

@ -26,7 +26,7 @@ local function DoFleshThrow(pl, wep)
ent:SetPos(startpos + heading * 8)
ent:SetOwner(pl)
ent:Spawn()
ent:SetTeamID(TEAM_UNDEAD)
local phys = ent:GetPhysicsObject()
if phys:IsValid() then
phys:SetVelocityInstantaneous(heading * math.Rand(340, 550))

View file

@ -52,8 +52,6 @@ function SWEP:Think()
ent:SetOwner(pl)
ent:Spawn()
ent:SetTeamID(TEAM_UNDEAD)
local phys = ent:GetPhysicsObject()
if phys:IsValid() then
local ang = pl:EyeAngles()

View file

@ -20,6 +20,7 @@ include("vgui/dteamcounter.lua")
include("vgui/dmodelpanelex.lua")
include("vgui/dammocounter.lua")
include("vgui/dteamheading.lua")
include("vgui/dmodelkillicon.lua")
include("vgui/dexroundedpanel.lua")
include("vgui/dexroundedframe.lua")

View file

@ -70,6 +70,7 @@ AddCSLuaFile("vgui/dammocounter.lua")
AddCSLuaFile("vgui/dpingmeter.lua")
AddCSLuaFile("vgui/dteamheading.lua")
AddCSLuaFile("vgui/dsidemenu.lua")
AddCSLuaFile("vgui/dmodelkillicon.lua")
AddCSLuaFile("vgui/dexroundedpanel.lua")
AddCSLuaFile("vgui/dexroundedframe.lua")

View file

@ -75,14 +75,6 @@ function meta:ResetBones(onlyscale)
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)
self:SetDTFloat(1, m)
end

View file

@ -1,8 +1,6 @@
local meta = FindMetaTable("Player")
if not meta then return end
meta.GetTeamID = meta.Team
function meta:GetMaxHealthEx()
if self:Team() == TEAM_UNDEAD then
return self:GetMaxZombieHealth()

View file

@ -166,7 +166,7 @@ if SERVER then
ent:SetPos(pos)
ent:SetOwner(pl)
ent:Spawn()
ent:SetTeamID(TEAM_UNDEAD)
local phys = ent:GetPhysicsObject()
if phys:IsValid() then
phys:Wake()

View file

@ -149,7 +149,7 @@ end
ent:SetPos(damagepos + heading)
ent:SetOwner(pl)
ent:Spawn()
ent:SetTeamID(TEAM_UNDEAD)
local phys = ent:GetPhysicsObject()
if phys:IsValid() then
phys:Wake()