Added cases for func_physbox_multiplayer

Used in a few counter-strike maps
This commit is contained in:
Ben 2014-11-22 18:41:04 +00:00
parent 6d5ed28bbf
commit cc7bb76139
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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