From db061a1ec316543aa2ee6f8f4a2470d562992d11 Mon Sep 17 00:00:00 2001 From: JetBoom Date: Sun, 7 Dec 2014 15:02:40 -0500 Subject: [PATCH] Remove useless SetTeamID functions. --- .../entities/entities/logic_brains/init.lua | 4 +--- .../entities/entities/logic_points/init.lua | 10 ++++------ .../entities/weapons/weapon_zs_bonemesh/init.lua | 2 +- .../entities/weapons/weapon_zs_ghoul.lua | 2 +- .../entities/weapons/weapon_zs_poisonzombie/init.lua | 2 +- .../entities/weapons/weapon_zs_pukepus.lua | 2 -- gamemodes/zombiesurvival/gamemode/cl_init.lua | 1 + gamemodes/zombiesurvival/gamemode/init.lua | 1 + .../zombiesurvival/gamemode/obj_entity_extend.lua | 8 -------- .../zombiesurvival/gamemode/obj_player_extend.lua | 2 -- .../gamemode/zombieclasses/bloated_zombie.lua | 2 +- .../zombiesurvival/gamemode/zombieclasses/ghoul.lua | 2 +- 12 files changed, 12 insertions(+), 26 deletions(-) diff --git a/gamemodes/zombiesurvival/entities/entities/logic_brains/init.lua b/gamemodes/zombiesurvival/entities/entities/logic_brains/init.lua index b129859..79dfa66 100644 --- a/gamemodes/zombiesurvival/entities/entities/logic_brains/init.lua +++ b/gamemodes/zombiesurvival/entities/entities/logic_brains/init.lua @@ -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) diff --git a/gamemodes/zombiesurvival/entities/entities/logic_points/init.lua b/gamemodes/zombiesurvival/entities/entities/logic_points/init.lua index 645f4c3..e13cc24 100644 --- a/gamemodes/zombiesurvival/entities/entities/logic_points/init.lua +++ b/gamemodes/zombiesurvival/entities/entities/logic_points/init.lua @@ -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 diff --git a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_bonemesh/init.lua b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_bonemesh/init.lua index 1fbe360..69030a8 100644 --- a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_bonemesh/init.lua +++ b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_bonemesh/init.lua @@ -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) diff --git a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_ghoul.lua b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_ghoul.lua index d236f9a..926754c 100644 --- a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_ghoul.lua +++ b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_ghoul.lua @@ -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)) diff --git a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_poisonzombie/init.lua b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_poisonzombie/init.lua index 735abdc..2ce4195 100644 --- a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_poisonzombie/init.lua +++ b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_poisonzombie/init.lua @@ -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)) diff --git a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_pukepus.lua b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_pukepus.lua index 989be5f..cf661c7 100644 --- a/gamemodes/zombiesurvival/entities/weapons/weapon_zs_pukepus.lua +++ b/gamemodes/zombiesurvival/entities/weapons/weapon_zs_pukepus.lua @@ -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() diff --git a/gamemodes/zombiesurvival/gamemode/cl_init.lua b/gamemodes/zombiesurvival/gamemode/cl_init.lua index d7ec577..440d9ad 100644 --- a/gamemodes/zombiesurvival/gamemode/cl_init.lua +++ b/gamemodes/zombiesurvival/gamemode/cl_init.lua @@ -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") diff --git a/gamemodes/zombiesurvival/gamemode/init.lua b/gamemodes/zombiesurvival/gamemode/init.lua index a5ca55a..bc97206 100644 --- a/gamemodes/zombiesurvival/gamemode/init.lua +++ b/gamemodes/zombiesurvival/gamemode/init.lua @@ -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") diff --git a/gamemodes/zombiesurvival/gamemode/obj_entity_extend.lua b/gamemodes/zombiesurvival/gamemode/obj_entity_extend.lua index c0df48c..1ae08d0 100644 --- a/gamemodes/zombiesurvival/gamemode/obj_entity_extend.lua +++ b/gamemodes/zombiesurvival/gamemode/obj_entity_extend.lua @@ -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 diff --git a/gamemodes/zombiesurvival/gamemode/obj_player_extend.lua b/gamemodes/zombiesurvival/gamemode/obj_player_extend.lua index 215778f..9317654 100644 --- a/gamemodes/zombiesurvival/gamemode/obj_player_extend.lua +++ b/gamemodes/zombiesurvival/gamemode/obj_player_extend.lua @@ -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() diff --git a/gamemodes/zombiesurvival/gamemode/zombieclasses/bloated_zombie.lua b/gamemodes/zombiesurvival/gamemode/zombieclasses/bloated_zombie.lua index b254e93..b6cbc7f 100644 --- a/gamemodes/zombiesurvival/gamemode/zombieclasses/bloated_zombie.lua +++ b/gamemodes/zombiesurvival/gamemode/zombieclasses/bloated_zombie.lua @@ -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() diff --git a/gamemodes/zombiesurvival/gamemode/zombieclasses/ghoul.lua b/gamemodes/zombiesurvival/gamemode/zombieclasses/ghoul.lua index c37927d..b4ffda1 100644 --- a/gamemodes/zombiesurvival/gamemode/zombieclasses/ghoul.lua +++ b/gamemodes/zombiesurvival/gamemode/zombieclasses/ghoul.lua @@ -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()