Merge pull request #45 from BClark09/master
Added cases for func_physbox_multiplayer
This commit is contained in:
commit
5b96000830
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
@ -2396,7 +2396,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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue