summaryrefslogtreecommitdiff
path: root/src/game/g_missile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_missile.c')
-rw-r--r--src/game/g_missile.c266
1 files changed, 153 insertions, 113 deletions
diff --git a/src/game/g_missile.c b/src/game/g_missile.c
index 26cb97e..14494cd 100644
--- a/src/game/g_missile.c
+++ b/src/game/g_missile.c
@@ -1,13 +1,14 @@
/*
===========================================================================
Copyright (C) 1999-2005 Id Software, Inc.
-Copyright (C) 2000-2006 Tim Angus
+Copyright (C) 2000-2013 Darklegion Development
+Copyright (C) 2015-2019 GrangerHub
This file is part of Tremulous.
Tremulous is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
-published by the Free Software Foundation; either version 2 of the License,
+published by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
Tremulous is distributed in the hope that it will be
@@ -16,8 +17,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with Tremulous; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+along with Tremulous; if not, see <https://www.gnu.org/licenses/>
+
===========================================================================
*/
@@ -82,7 +83,6 @@ void G_ExplodeMissile( gentity_t *ent )
ent->s.eType = ET_GENERAL;
- //TA: tired... can't be fucked... hack
if( ent->s.weapon != WP_LOCKBLOB_LAUNCHER &&
ent->s.weapon != WP_FLAMER )
G_AddEvent( ent, EV_MISSILE_MISS, DirToByte( dir ) );
@@ -92,7 +92,7 @@ void G_ExplodeMissile( gentity_t *ent )
// splash damage
if( ent->splashDamage )
G_RadiusDamage( ent->r.currentOrigin, ent->parent, ent->splashDamage,
- ent->splashRadius, ent, ent->dflags, ent->splashMethodOfDeath );
+ ent->splashRadius, ent, ent->splashMethodOfDeath );
trap_LinkEntity( ent );
}
@@ -140,7 +140,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace )
}
else if( !strcmp( ent->classname, "lockblob" ) )
{
- if( other->client && other->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
+ if( other->client && other->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS )
{
other->client->ps.stats[ STAT_STATE ] |= SS_BLOBLOCKED;
other->client->lastLockTime = level.time;
@@ -150,7 +150,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace )
}
else if( !strcmp( ent->classname, "slowblob" ) )
{
- if( other->client && other->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
+ if( other->client && other->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS )
{
other->client->ps.stats[ STAT_STATE ] |= SS_SLOWLOCKED;
other->client->lastSlowTime = level.time;
@@ -175,11 +175,11 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace )
//prevent collision with the client when returning
ent->r.ownerNum = other->s.number;
- ent->think = AHive_ReturnToHive;
+ ent->think = G_ExplodeMissile;
ent->nextthink = level.time + FRAMETIME;
//only damage humans
- if( other->client && other->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
+ if( other->client && other->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS )
returnAfterDamage = qtrue;
else
return;
@@ -198,8 +198,8 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace )
if( VectorLength( velocity ) == 0 )
velocity[ 2 ] = 1; // stepped on a grenade
- G_Damage( other, ent, attacker, velocity, ent->s.origin, ent->damage,
- ent->dflags, ent->methodOfDeath );
+ G_Damage( other, ent, attacker, velocity, ent->r.currentOrigin, ent->damage,
+ DAMAGE_NO_LOCDAMAGE, ent->methodOfDeath );
}
}
@@ -209,7 +209,8 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace )
// is it cheaper in bandwidth to just remove this ent and create a new
// one, rather than changing the missile into the explosion?
- if( other->takedamage && other->client )
+ if( other->takedamage &&
+ ( other->s.eType == ET_PLAYER || other->s.eType == ET_BUILDABLE ) )
{
G_AddEvent( ent, EV_MISSILE_HIT, DirToByte( trace->plane.normal ) );
ent->s.otherEntityNum = other->s.number;
@@ -231,7 +232,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace )
// splash damage (doesn't apply to person directly hit)
if( ent->splashDamage )
G_RadiusDamage( trace->endpos, ent->parent, ent->splashDamage, ent->splashRadius,
- other, ent->dflags, ent->splashMethodOfDeath );
+ other, ent->splashMethodOfDeath );
trap_LinkEntity( ent );
}
@@ -247,7 +248,8 @@ void G_RunMissile( gentity_t *ent )
{
vec3_t origin;
trace_t tr;
- int passent;
+ int passent;
+ qboolean impact = qfalse;
// get current position
BG_EvaluateTrajectory( &ent->s.pos, level.time, origin );
@@ -255,40 +257,73 @@ void G_RunMissile( gentity_t *ent )
// ignore interactions with the missile owner
passent = ent->r.ownerNum;
- // trace a line from the previous position to the current position
- trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, origin, passent, ent->clipmask );
+ // general trace to see if we hit anything at all
+ trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs,
+ origin, passent, ent->clipmask );
if( tr.startsolid || tr.allsolid )
{
- // make sure the tr.entityNum is set to the entity we're stuck in
- trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, ent->r.currentOrigin, passent, ent->clipmask );
- tr.fraction = 0;
+ tr.fraction = 0.0f;
+ VectorCopy( ent->r.currentOrigin, tr.endpos );
}
- else
- VectorCopy( tr.endpos, ent->r.currentOrigin );
- ent->r.contents = CONTENTS_SOLID; //trick trap_LinkEntity into...
- trap_LinkEntity( ent );
- ent->r.contents = 0; //...encoding bbox information
+ if( tr.fraction < 1.0f )
+ {
+ if( !ent->pointAgainstWorld || tr.contents & CONTENTS_BODY )
+ {
+ // We hit an entity or we don't care
+ impact = qtrue;
+ }
+ else
+ {
+ trap_Trace( &tr, ent->r.currentOrigin, NULL, NULL, origin,
+ passent, ent->clipmask );
+
+ if( tr.fraction < 1.0f )
+ {
+ // Hit the world with point trace
+ impact = qtrue;
+ }
+ else
+ {
+ if( tr.contents & CONTENTS_BODY )
+ {
+ // Hit an entity
+ impact = qtrue;
+ }
+ else
+ {
+ trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs,
+ origin, passent, CONTENTS_BODY );
+
+ if( tr.fraction < 1.0f )
+ impact = qtrue;
+ }
+ }
+ }
+ }
- if( tr.fraction != 1 )
+ VectorCopy( tr.endpos, ent->r.currentOrigin );
+
+ if( impact )
{
- // never explode or bounce on sky
if( tr.surfaceFlags & SURF_NOIMPACT )
{
- // If grapple, reset owner
- if( ent->parent && ent->parent->client && ent->parent->client->hook == ent )
- ent->parent->client->hook = NULL;
-
+ // Never explode or bounce on sky
G_FreeEntity( ent );
return;
}
G_MissileImpact( ent, &tr );
+
if( ent->s.eType != ET_MISSILE )
return; // exploded
}
+ ent->r.contents = CONTENTS_SOLID; //trick trap_LinkEntity into...
+ trap_LinkEntity( ent );
+ ent->r.contents = 0; //...encoding bbox information
+
// check think function after bouncing
G_RunThink( ent );
}
@@ -311,23 +346,23 @@ gentity_t *fire_flamer( gentity_t *self, vec3_t start, vec3_t dir )
bolt = G_Spawn();
bolt->classname = "flame";
+ bolt->pointAgainstWorld = qfalse;
bolt->nextthink = level.time + FLAMER_LIFETIME;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
- bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_FLAMER;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = FLAMER_DMG;
- bolt->splashDamage = FLAMER_DMG;
+ bolt->splashDamage = FLAMER_SPLASHDAMAGE;
bolt->splashRadius = FLAMER_RADIUS;
bolt->methodOfDeath = MOD_FLAMER;
bolt->splashMethodOfDeath = MOD_FLAMER_SPLASH;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
- bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -15.0f;
- bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = 15.0f;
+ bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -FLAMER_SIZE;
+ bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = FLAMER_SIZE;
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
@@ -357,10 +392,10 @@ gentity_t *fire_blaster( gentity_t *self, vec3_t start, vec3_t dir )
bolt = G_Spawn();
bolt->classname = "blaster";
+ bolt->pointAgainstWorld = qtrue;
bolt->nextthink = level.time + 10000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
- bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_BLASTER;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
@@ -372,6 +407,8 @@ gentity_t *fire_blaster( gentity_t *self, vec3_t start, vec3_t dir )
bolt->splashMethodOfDeath = MOD_BLASTER;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
+ bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -BLASTER_SIZE;
+ bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = BLASTER_SIZE;
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
@@ -400,10 +437,10 @@ gentity_t *fire_pulseRifle( gentity_t *self, vec3_t start, vec3_t dir )
bolt = G_Spawn();
bolt->classname = "pulse";
+ bolt->pointAgainstWorld = qtrue;
bolt->nextthink = level.time + 10000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
- bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_PULSE_RIFLE;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
@@ -415,6 +452,8 @@ gentity_t *fire_pulseRifle( gentity_t *self, vec3_t start, vec3_t dir )
bolt->splashMethodOfDeath = MOD_PRIFLE;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
+ bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] = -PRIFLE_SIZE;
+ bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] = PRIFLE_SIZE;
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
@@ -435,42 +474,53 @@ fire_luciferCannon
=================
*/
-gentity_t *fire_luciferCannon( gentity_t *self, vec3_t start, vec3_t dir, int damage, int radius )
+gentity_t *fire_luciferCannon( gentity_t *self, vec3_t start, vec3_t dir,
+ int damage, int radius, int speed )
{
gentity_t *bolt;
- int localDamage = (int)( ceil( ( (float)damage /
- (float)LCANNON_TOTAL_CHARGE ) * (float)LCANNON_DAMAGE ) );
+ float charge;
VectorNormalize( dir );
bolt = G_Spawn( );
bolt->classname = "lcannon";
+ bolt->pointAgainstWorld = qtrue;
- if( damage == LCANNON_TOTAL_CHARGE )
+ if( damage == LCANNON_DAMAGE )
bolt->nextthink = level.time;
else
bolt->nextthink = level.time + 10000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
- bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_LUCIFER_CANNON;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
- bolt->damage = localDamage;
- bolt->dflags = DAMAGE_KNOCKBACK;
- bolt->splashDamage = localDamage / 2;
+ bolt->damage = damage;
+ bolt->splashDamage = damage / 2;
bolt->splashRadius = radius;
bolt->methodOfDeath = MOD_LCANNON;
bolt->splashMethodOfDeath = MOD_LCANNON_SPLASH;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
+
+ // Give the missile a small bounding box
+ bolt->r.mins[ 0 ] = bolt->r.mins[ 1 ] = bolt->r.mins[ 2 ] =
+ -LCANNON_SIZE;
+ bolt->r.maxs[ 0 ] = bolt->r.maxs[ 1 ] = bolt->r.maxs[ 2 ] =
+ -bolt->r.mins[ 0 ];
+
+ // Pass the missile charge through
+ charge = (float)( damage - LCANNON_SECONDARY_DAMAGE ) / LCANNON_DAMAGE;
+ bolt->s.torsoAnim = charge * 255;
+ if( bolt->s.torsoAnim < 0 )
+ bolt->s.torsoAnim = 0;
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
- VectorScale( dir, LCANNON_SPEED, bolt->s.pos.trDelta );
+ VectorScale( dir, speed, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
@@ -492,17 +542,16 @@ gentity_t *launch_grenade( gentity_t *self, vec3_t start, vec3_t dir )
bolt = G_Spawn( );
bolt->classname = "grenade";
+ bolt->pointAgainstWorld = qfalse;
bolt->nextthink = level.time + 5000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
- bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_GRENADE;
bolt->s.eFlags = EF_BOUNCE_HALF;
bolt->s.generic1 = WPM_PRIMARY; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = GRENADE_DAMAGE;
- bolt->dflags = DAMAGE_KNOCKBACK;
bolt->splashDamage = GRENADE_DAMAGE;
bolt->splashRadius = GRENADE_RANGE;
bolt->methodOfDeath = MOD_GRENADE;
@@ -525,85 +574,79 @@ gentity_t *launch_grenade( gentity_t *self, vec3_t start, vec3_t dir )
}
//=============================================================================
+
+
/*
================
-AHive_ReturnToHive
+AHive_SearchAndDestroy
-Adjust the trajectory to point towards the hive
+Adjust the trajectory to point towards the target
================
*/
-void AHive_ReturnToHive( gentity_t *self )
+void AHive_SearchAndDestroy( gentity_t *self )
{
- vec3_t dir;
- trace_t tr;
-
- if( !self->parent )
- {
- G_Printf( S_COLOR_YELLOW "WARNING: AHive_ReturnToHive called with no self->parent\n" );
- return;
- }
+ vec3_t dir;
+ trace_t tr;
+ gentity_t *ent;
+ int i;
+ float d, nearest;
- trap_UnlinkEntity( self->parent );
- trap_Trace( &tr, self->r.currentOrigin, self->r.mins, self->r.maxs,
- self->parent->r.currentOrigin, self->r.ownerNum, self->clipmask );
- trap_LinkEntity( self->parent );
+ if( self->parent && !self->parent->inuse )
+ self->parent = NULL;
- if( tr.fraction < 1.0f )
+ if( level.time > self->timestamp )
{
- //if can't see hive then disperse
VectorCopy( self->r.currentOrigin, self->s.pos.trBase );
self->s.pos.trType = TR_STATIONARY;
self->s.pos.trTime = level.time;
self->think = G_ExplodeMissile;
- self->nextthink = level.time + 2000;
- self->parent->active = qfalse; //allow the parent to start again
+ self->nextthink = level.time + 50;
+ if( self->parent )
+ self->parent->active = qfalse; //allow the parent to start again
+ return;
}
+
+ ent = self->target_ent;
+ if( ent && ent->health > 0 && ent->client && ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS )
+ nearest = DistanceSquared( self->r.currentOrigin, ent->r.currentOrigin );
else
{
- VectorSubtract( self->parent->r.currentOrigin, self->r.currentOrigin, dir );
- VectorNormalize( dir );
-
- //change direction towards the hive
- VectorScale( dir, HIVE_SPEED, self->s.pos.trDelta );
- SnapVector( self->s.pos.trDelta ); // save net bandwidth
- VectorCopy( self->r.currentOrigin, self->s.pos.trBase );
- self->s.pos.trTime = level.time;
-
- self->think = G_ExplodeMissile;
- self->nextthink = level.time + 15000;
+ self->target_ent = NULL;
+ nearest = 0; // silence warning
}
-}
-
-/*
-================
-AHive_SearchAndDestroy
-Adjust the trajectory to point towards the target
-================
-*/
-void AHive_SearchAndDestroy( gentity_t *self )
-{
- vec3_t dir;
- trace_t tr;
-
- trap_Trace( &tr, self->r.currentOrigin, self->r.mins, self->r.maxs,
- self->target_ent->r.currentOrigin, self->r.ownerNum, self->clipmask );
-
- //if there is no LOS or the parent hive is too far away or the target is dead or notargeting, return
- if( tr.entityNum == ENTITYNUM_WORLD ||
- Distance( self->r.currentOrigin, self->parent->r.currentOrigin ) > ( HIVE_RANGE * 5 ) ||
- self->target_ent->health <= 0 || self->target_ent->flags & FL_NOTARGET )
+ //find the closest human
+ for( i = 0; i < MAX_CLIENTS; i++ )
{
- self->r.ownerNum = ENTITYNUM_WORLD;
+ ent = &g_entities[ i ];
+
+ if( ent->flags & FL_NOTARGET )
+ continue;
- self->think = AHive_ReturnToHive;
- self->nextthink = level.time + FRAMETIME;
+ if( ent->client &&
+ ent->health > 0 &&
+ ent->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS &&
+ ( d = DistanceSquared( ent->r.currentOrigin, self->r.currentOrigin ),
+ ( self->target_ent == NULL || d < nearest ) ) )
+ {
+ trap_Trace( &tr, self->r.currentOrigin, self->r.mins, self->r.maxs,
+ ent->r.currentOrigin, self->r.ownerNum, self->clipmask );
+ if( tr.entityNum != ENTITYNUM_WORLD )
+ {
+ nearest = d;
+ self->target_ent = ent;
+ }
+ }
}
+
+ if( self->target_ent == NULL )
+ VectorClear( dir );
else
{
VectorSubtract( self->target_ent->r.currentOrigin, self->r.currentOrigin, dir );
VectorNormalize( dir );
+ }
//change direction towards the player
VectorScale( dir, HIVE_SPEED, self->s.pos.trDelta );
@@ -612,7 +655,6 @@ void AHive_SearchAndDestroy( gentity_t *self )
self->s.pos.trTime = level.time;
self->nextthink = level.time + HIVE_DIR_CHANGE_PERIOD;
- }
}
/*
@@ -628,11 +670,11 @@ gentity_t *fire_hive( gentity_t *self, vec3_t start, vec3_t dir )
bolt = G_Spawn( );
bolt->classname = "hive";
+ bolt->pointAgainstWorld = qfalse;
bolt->nextthink = level.time + HIVE_DIR_CHANGE_PERIOD;
bolt->think = AHive_SearchAndDestroy;
bolt->s.eType = ET_MISSILE;
- bolt->s.eFlags |= EF_BOUNCE|EF_NO_BOUNCE_SOUND;
- bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
+ bolt->s.eFlags |= EF_BOUNCE | EF_NO_BOUNCE_SOUND;
bolt->s.weapon = WP_HIVE;
bolt->s.generic1 = WPM_PRIMARY; //weaponMode
bolt->r.ownerNum = self->s.number;
@@ -643,6 +685,7 @@ gentity_t *fire_hive( gentity_t *self, vec3_t start, vec3_t dir )
bolt->methodOfDeath = MOD_SWARM;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = self->target_ent;
+ bolt->timestamp = level.time + HIVE_LIFETIME;
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
@@ -669,10 +712,10 @@ gentity_t *fire_lockblob( gentity_t *self, vec3_t start, vec3_t dir )
bolt = G_Spawn( );
bolt->classname = "lockblob";
+ bolt->pointAgainstWorld = qtrue;
bolt->nextthink = level.time + 15000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
- bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_LOCKBLOB_LAUNCHER;
bolt->s.generic1 = WPM_PRIMARY; //weaponMode
bolt->r.ownerNum = self->s.number;
@@ -707,10 +750,10 @@ gentity_t *fire_slowBlob( gentity_t *self, vec3_t start, vec3_t dir )
bolt = G_Spawn( );
bolt->classname = "slowblob";
+ bolt->pointAgainstWorld = qtrue;
bolt->nextthink = level.time + 15000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
- bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_ABUILD2;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
@@ -746,10 +789,10 @@ gentity_t *fire_paraLockBlob( gentity_t *self, vec3_t start, vec3_t dir )
bolt = G_Spawn( );
bolt->classname = "lockblob";
+ bolt->pointAgainstWorld = qtrue;
bolt->nextthink = level.time + 15000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
- bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_LOCKBLOB_LAUNCHER;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
@@ -783,18 +826,17 @@ gentity_t *fire_bounceBall( gentity_t *self, vec3_t start, vec3_t dir )
bolt = G_Spawn( );
bolt->classname = "bounceball";
+ bolt->pointAgainstWorld = qtrue;
bolt->nextthink = level.time + 3000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
- bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_ALEVEL3_UPG;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = LEVEL3_BOUNCEBALL_DMG;
- bolt->dflags = DAMAGE_KNOCKBACK;
- bolt->splashDamage = 0;
- bolt->splashRadius = 0;
+ bolt->splashDamage = LEVEL3_BOUNCEBALL_DMG;
+ bolt->splashRadius = LEVEL3_BOUNCEBALL_RADIUS;
bolt->methodOfDeath = MOD_LEVEL3_BOUNCEBALL;
bolt->splashMethodOfDeath = MOD_LEVEL3_BOUNCEBALL;
bolt->clipmask = MASK_SHOT;
@@ -806,8 +848,6 @@ gentity_t *fire_bounceBall( gentity_t *self, vec3_t start, vec3_t dir )
VectorScale( dir, LEVEL3_BOUNCEBALL_SPEED, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
- /*bolt->s.eFlags |= EF_BOUNCE;*/
return bolt;
}
-