diff --git a/source/server/ai/zombie_core.qc b/source/server/ai/zombie_core.qc index d558e66..8c061e1 100644 --- a/source/server/ai/zombie_core.qc +++ b/source/server/ai/zombie_core.qc @@ -1537,6 +1537,12 @@ void(entity szombie) SetUpHitBoxes = szombie.rarm.classname = "ai_zombie_rarm"; szombie.rarm.takedamage = DAMAGE_YES; +#ifdef PC + szombie.head.dimension_solid = HITBOX_DIM_LIMBS; + szombie.larm.dimension_solid = HITBOX_DIM_LIMBS; + szombie.rarm.dimension_solid = HITBOX_DIM_LIMBS; +#endif // PC + local entity oldself = self; self = szombie; SetZombieHitBox(BASE_BBOX); @@ -1645,7 +1651,10 @@ void(entity where) spawn_a_zombieB = #endif - szombie.solid = szombie.head.solid = SOLID_CORPSE; + szombie.solid = SOLID_CORPSE; +#ifdef PC + szombie.dimension_solid = HITBOX_DIM_ZOMBIES; +#endif // PC szombie.movetype = MOVETYPE_WALK; setmodel(szombie, "models/ai/zb#.mdl"); szombie.hop_step = 0; diff --git a/source/server/defs/custom.qc b/source/server/defs/custom.qc index dd38b1f..2f9b280 100644 --- a/source/server/defs/custom.qc +++ b/source/server/defs/custom.qc @@ -258,6 +258,11 @@ float crawler_num; #define WIDLEBOX 16 //======================== +// Definitions for the `.dimension_hit` and `.dimension_solid` fields +// Used to let limbs be non-solid to player bbox but still be hit by player tracelines +#define HITBOX_DIM_LIMBS 1 +#define HITBOX_DIM_ZOMBIES 2 + //we're using usedent for who is currently hopping the window //Used for windows to keep track of what zombies are at windows .entity box1owner, box2owner, box3owner; diff --git a/source/server/player.qc b/source/server/player.qc index 0048ac9..f3d06f7 100644 --- a/source/server/player.qc +++ b/source/server/player.qc @@ -517,6 +517,10 @@ void() PlayerSpawn = self.isspec = FALSE; self.classname = "player"; self.solid = SOLID_BBOX; + // We can only collide with zombies (and not their limbs) +#ifdef PC + self.dimension_hit = HITBOX_DIM_ZOMBIES; +#endif // PC setmodel(self, "models/player.mdl"); self.movetype = MOVETYPE_WALK; self.max_health = self.health = 100; diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index 0066b66..7fe3540 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -1547,7 +1547,13 @@ void(float side) W_Fire = // Weapon Projectile/Trace Logic. if (Util_WeaponFiresTraceshot(self.weapon)) { +#ifdef PC + self.dimension_hit = HITBOX_DIM_LIMBS | HITBOX_DIM_ZOMBIES; +#endif // PC FireTrace(shotcount, spread, damage, side); +#ifdef PC + self.dimension_hit = HITBOX_DIM_ZOMBIES; +#endif // PC } switch(firetype) {