diff options
author | Roman Tetelman <kevlarman@gmail.com> | 2009-10-03 12:29:18 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:15:59 +0000 |
commit | 70348f182bf8f21b99ca66bf427468588cb41534 (patch) | |
tree | e4458776ae04f9070d2d933e7aa2b860072f2ab9 /src/game | |
parent | 3c731fb78a0499827a3352640b8e3ca4de0bcbf8 (diff) |
* Give mass driver a small width (5u for now)
* Fix event names in bg_misc.c (was making debugging difficult)
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 1 | ||||
-rw-r--r-- | src/game/g_weapon.c | 16 | ||||
-rw-r--r-- | src/game/tremulous.h | 1 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index d5e1e1c2..567bb8c7 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -2767,6 +2767,7 @@ char *eventnames[ ] = "EV_BULLET_HIT_WALL", "EV_SHOTGUN", + "EV_MASS_DRIVER", "EV_MISSILE_HIT", "EV_MISSILE_MISS", diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 41ec53f8..7c3ed254 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -466,21 +466,14 @@ MASS DRIVER void massDriverFire( gentity_t *ent ) { trace_t tr; - vec3_t end; gentity_t *tent; gentity_t *traceEnt; - VectorMA( muzzle, 8192 * 16, forward, end ); - - G_UnlaggedOn( ent, muzzle, 8192 * 16 ); - trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); - G_UnlaggedOff( ); + G_WideTrace( &tr, ent, 8192.0f * 16.0f, MDRIVER_WIDTH, MDRIVER_WIDTH, &traceEnt ); if( tr.surfaceFlags & SURF_NOIMPACT ) return; - traceEnt = &g_entities[ tr.entityNum ]; - // snap the endpos to integers, but nudged towards the line SnapVectorTowards( tr.endpos, muzzle ); @@ -489,10 +482,15 @@ void massDriverFire( gentity_t *ent ) (traceEnt->s.eType == ET_BUILDABLE || traceEnt->s.eType == ET_PLAYER ) ) { - BloodSpurt( ent, traceEnt, &tr ); + WideBloodSpurt( ent, traceEnt, &tr ); } else { + // If we missed, G_WideTrace hasn't traced against the world + // so we need to do another trace to find the endpoint + vec3_t end; + VectorMA( muzzle, 8192.0f * 16.0f, forward, end ); + trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, CONTENTS_SOLID ); tent = G_TempEntity( tr.endpos, EV_MISSILE_MISS ); tent->s.eventParm = DirToByte( tr.plane.normal ); tent->s.weapon = ent->s.weapon; diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 656f3c00..40887cf2 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -423,6 +423,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define MDRIVER_REPEAT 1000 #define MDRIVER_K_SCALE 1.0f #define MDRIVER_RELOAD 2000 +#define MDRIVER_WIDTH 5 #define CHAINGUN_PRICE 400 #define CHAINGUN_BULLETS 300 |