From cc7bb76139a30f0812c7d3db653e2c1e5260198d Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 22 Nov 2014 18:41:04 +0000 Subject: [PATCH] Added cases for func_physbox_multiplayer Used in a few counter-strike maps --- gamemodes/zombiesurvival/gamemode/init.lua | 6 +++--- gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gamemodes/zombiesurvival/gamemode/init.lua b/gamemodes/zombiesurvival/gamemode/init.lua index 2d3d0a4..8aaa9a9 100644 --- a/gamemodes/zombiesurvival/gamemode/init.lua +++ b/gamemodes/zombiesurvival/gamemode/init.lua @@ -157,8 +157,8 @@ function GM:TryHumanPickup(pl, entity) if self.ZombieEscape or pl.NoObjectPickup then return end if entity:IsValid() and not entity.m_NoPickup then - local entclass = entity:GetClass() - if (string.sub(entclass, 1, 12) == "prop_physics" or entclass == "func_physbox" or entity.HumanHoldable and entity:HumanHoldable(pl)) and pl:Team() == TEAM_HUMAN and not entity:IsNailed() and pl:Alive() and entity:GetMoveType() == MOVETYPE_VPHYSICS and entity:GetPhysicsObject():IsValid() and entity:GetPhysicsObject():GetMass() <= CARRY_MAXIMUM_MASS and entity:GetPhysicsObject():IsMoveable() and entity:OBBMins():Length() + entity:OBBMaxs():Length() <= CARRY_MAXIMUM_VOLUME then + local entclass = string.sub(entity:GetClass(), 1, 12) + if (entclass == "prop_physics" or entclass == "func_physbox" or entity.HumanHoldable and entity:HumanHoldable(pl)) and pl:Team() == TEAM_HUMAN and not entity:IsNailed() and pl:Alive() and entity:GetMoveType() == MOVETYPE_VPHYSICS and entity:GetPhysicsObject():IsValid() and entity:GetPhysicsObject():GetMass() <= CARRY_MAXIMUM_MASS and entity:GetPhysicsObject():IsMoveable() and entity:OBBMins():Length() + entity:OBBMaxs():Length() <= CARRY_MAXIMUM_VOLUME then local holder, status = entity:GetHolder() if not holder and not pl:IsHolding() and CurTime() >= (pl.NextHold or 0) and pl:GetShootPos():Distance(entity:NearestPoint(pl:GetShootPos())) <= 64 and pl:GetGroundEntity() ~= entity then @@ -2395,7 +2395,7 @@ function GM:EntityTakeDamage(ent, dmginfo) end end end - elseif entclass == "func_physbox" then + elseif string.sub(entclass, 1, 12) == "func_physbox" then local holder, status = ent:GetHolder() if holder then status:Remove() end diff --git a/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua b/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua index 054af62..89a5113 100644 --- a/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua +++ b/gamemodes/zombiesurvival/gamemode/obj_entity_extend_sv.lua @@ -250,7 +250,7 @@ end meta.OldSetPhysicsAttacker = meta.SetPhysicsAttacker function meta:SetPhysicsAttacker(ent) - if self:GetClass() == "func_physbox" and ent:IsValid() then + if string.sub(self:GetClass(), 1, 12) == "func_physbox" and ent:IsValid() then self.PBAttacker = ent self.NPBAttacker = CurTime() + 1 end