From c7a9eefcedd7ed5e28550cba8084f0f780f866ce Mon Sep 17 00:00:00 2001 From: div0 Date: Thu, 30 Jul 2009 06:27:57 +0000 Subject: [PATCH] next attempt: make projectiles SOLID_CORPSE so they reliably hit anything, but cannot be hit by player/spectator movement. SOLID_TRIGGER failed at this because these move with a only-bmodels trace. SOLID_BBOX failed because a SOLID_NOT moving into a SOLID_BBOX causes a hit, and also blocks the SOLID_BBOX. SOLID_CORPSE is chosen because players have a hit contents mask that allows them to move into SOLID_CORPSE. Due to an override hit contents mask, the SOLID_CORPSE projectiles still detonate on impact to "other" corpses (including other projectiles, although this is unlikely). git-svn-id: svn://svn.icculus.org/nexuiz/trunk@7283 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/constants.qh | 1 - data/qcsrc/server/defs.qh | 4 ++-- data/qcsrc/server/miscfunctions.qc | 9 +++++++++ data/qcsrc/server/w_laser.qc | 3 --- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/data/qcsrc/server/constants.qh b/data/qcsrc/server/constants.qh index 5aba76fc0..4e455fa77 100644 --- a/data/qcsrc/server/constants.qh +++ b/data/qcsrc/server/constants.qh @@ -42,7 +42,6 @@ float SOLID_TRIGGER = 1; float SOLID_BBOX = 2; float SOLID_SLIDEBOX = 3; float SOLID_BSP = 4; -//float SOLID_CORPSE = 5; // Unobstructed by CORPSE or SLIDEBOX float DEAD_NO = 0; float DEAD_DYING = 1; diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 586d3328a..508dc11fc 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -610,6 +610,6 @@ float client_cefc_accumulatortime; .float campingrifle_bulletcounter; -// #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_TRIGGER; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE +#define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE // when doing this, hagar can go through clones -#define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX +// #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc index 33d86da83..961fd7334 100644 --- a/data/qcsrc/server/miscfunctions.qc +++ b/data/qcsrc/server/miscfunctions.qc @@ -1875,6 +1875,15 @@ float tracebox_hits_box(vector start, vector mi, vector ma, vector end, vector t float SUB_NoImpactCheck() { + // zero hitcontents = this is not the real impact, but either the + // mirror-impact of something hitting the projectile instead of the + // projectile hitting the something, or a touchareagrid one. Neither of + // these stop the projectile from moving, so... + if(trace_dphitcontents == 0) + { + dprint("A hit happened with zero hit contents... DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct.\n"); + checkclient(); + } if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) return 1; if (other == world && self.size != '0 0 0') diff --git a/data/qcsrc/server/w_laser.qc b/data/qcsrc/server/w_laser.qc index fbfd742f6..a07e322a6 100644 --- a/data/qcsrc/server/w_laser.qc +++ b/data/qcsrc/server/w_laser.qc @@ -4,9 +4,6 @@ void W_Laser_Touch (void) { PROJECTILE_TOUCH; - if(other.classname == "spectator") - checkclient(); // TODO put a breakpoint on this, and wait till it hits! - self.event_damage = SUB_Null; if (self.dmg) RadiusDamage (self, self.owner, cvar("g_balance_laser_secondary_damage"), cvar("g_balance_laser_secondary_edgedamage"), cvar("g_balance_laser_secondary_radius"), world, cvar("g_balance_laser_secondary_force"), self.projectiledeathtype, other); -- 2.39.2