summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2003-09-03 20:35:34 +0000
committerTim Angus <tim@ngus.net>2003-09-03 20:35:34 +0000
commit4b7492531a70a97c4bfbd211564cfd0a192c58d6 (patch)
tree0267ab6c0486f60aa6049189eb7e9d57f8d820e7
parent196414d90900f25d5ff45b3deb52b8e66a48bf0d (diff)
* Fixed missing creep scaledown
* Removed unnecessary enitity relinks in g_buildable.c
-rw-r--r--src/cgame/cg_buildable.c12
-rw-r--r--src/game/bg_public.h2
-rw-r--r--src/game/g_buildable.c31
3 files changed, 17 insertions, 28 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c
index 00c7bf68..7e03ae6d 100644
--- a/src/cgame/cg_buildable.c
+++ b/src/cgame/cg_buildable.c
@@ -34,7 +34,6 @@ char *cg_buildableSoundNames[ MAX_BUILDABLE_ANIMATIONS ] =
sfxHandle_t defaultAlienSounds[ MAX_BUILDABLE_ANIMATIONS ];
sfxHandle_t defaultHumanSounds[ MAX_BUILDABLE_ANIMATIONS ];
-#define CREEP_SCALEUP_TIME 3000
#define CREEP_SCALEDOWN_TIME 3000
#define CREEP_SIZE 64.0f
@@ -786,10 +785,14 @@ void CG_Buildable( centity_t *cent )
vec3_t refNormal = { 0.0f, 0.0f, 1.0f };
float rotAngle;
trace_t tr;
- buildableTeam_t team = BG_FindTeamForBuildable( es->modelindex );
+ buildableTeam_t team = BG_FindTeamForBuildable( es->modelindex2 );
+
+ //must be before EF_NODRAW check
+ if( team == BIT_ALIENS )
+ CG_Creep( cent );
// if set to invisible, skip
- if ( !es->modelindex || ( es->eFlags & EF_NODRAW ) )
+ if( !es->modelindex || ( es->eFlags & EF_NODRAW ) )
return;
memset ( &ent, 0, sizeof( ent ) );
@@ -837,11 +840,8 @@ void CG_Buildable( centity_t *cent )
ent.nonNormalizedAxes = qfalse;
- //add creep
if( team == BIT_ALIENS )
{
- CG_Creep( cent );
-
if( es->generic1 & B_SPAWNED_TOGGLEBIT )
{
//run animations
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 49c8430d..42d8f5bd 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -555,7 +555,7 @@ typedef enum
MN_A_NOFUNDS,
MN_A_NOEROOM,
- //alien build denial menus
+ //alien build
MN_A_SPWNWARN,
MN_A_OVERMIND,
MN_A_NOASSERT,
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index d7b26ee4..69fcf330 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -357,10 +357,7 @@ void A_CreepRecede( gentity_t *self )
//creep is still receeding
if( ( self->timestamp + 10000 ) > level.time )
- {
self->nextthink = level.time + 500;
- trap_LinkEntity( self );
- }
else //creep has died
G_FreeEntity( self );
}
@@ -382,9 +379,8 @@ Called when an alien spawn dies
*/
void ASpawn_Melt( gentity_t *self )
{
- //FIXME: this line crashes the QVM (but not binary when MOD is set to MOD_[H/D]SPAWN
G_SelectiveRadiusDamage( self->s.pos.trBase, self->parent, self->splashDamage,
- self->splashRadius, self, MOD_ASPAWN, PTE_ALIENS );
+ self->splashRadius, self, self->splashMethodOfDeath, PTE_ALIENS );
//start creep recession
if( !( self->s.eFlags & EF_DEAD ) )
@@ -395,10 +391,7 @@ void ASpawn_Melt( gentity_t *self )
//not dead yet
if( ( self->timestamp + 10000 ) > level.time )
- {
self->nextthink = level.time + 500;
- trap_LinkEntity( self );
- }
else //dead now
G_FreeEntity( self );
}
@@ -425,12 +418,12 @@ void ASpawn_Blast( gentity_t *self )
//pretty events and item cleanup
self->s.modelindex = 0; //don't draw the model once its destroyed
G_AddEvent( self, EV_GIB_ALIEN, DirToByte( dir ) );
- self->r.contents = CONTENTS_TRIGGER;
self->timestamp = level.time;
self->think = ASpawn_Melt;
self->nextthink = level.time + 500; //wait .5 seconds before damaging others
- trap_LinkEntity( self );
+ self->r.contents = 0; //stop collisions...
+ trap_LinkEntity( self ); //...requires a relink
}
/*
@@ -456,8 +449,6 @@ void ASpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
else if( self->s.modelindex == BA_A_SPAWN )
attacker->client->ps.persistant[ PERS_CREDIT ] += ASPAWN_VALUE;
}
-
- trap_LinkEntity( self );
}
/*
@@ -643,12 +634,12 @@ void ABarricade_Blast( gentity_t *self )
//pretty events and item cleanup
self->s.modelindex = 0; //don't draw the model once its destroyed
G_AddEvent( self, EV_GIB_ALIEN, DirToByte( dir ) );
- self->r.contents = CONTENTS_TRIGGER;
self->timestamp = level.time;
self->think = A_CreepRecede;
self->nextthink = level.time + 500; //wait .5 seconds before damaging others
- trap_LinkEntity( self );
+ self->r.contents = 0; //stop collisions...
+ trap_LinkEntity( self ); //...requires a relink
}
/*
@@ -666,8 +657,6 @@ void ABarricade_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker,
self->die = nullDieFunction;
self->think = ABarricade_Blast;
self->nextthink = level.time + 5000;
-
- trap_LinkEntity( self );
}
/*
@@ -938,7 +927,6 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
//pretty events and item cleanup
self->s.modelindex = 0; //don't draw the model once its destroyed
G_AddEvent( self, EV_GIB_ALIEN, DirToByte( dir ) );
- self->r.contents = CONTENTS_TRIGGER;
self->timestamp = level.time;
self->think = ASpawn_Melt;
self->nextthink = level.time + 500; //wait .5 seconds before damaging others
@@ -967,7 +955,8 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
builder->client->ps.stats[ STAT_STATE ] &= ~SS_HOVELING;
}
- trap_LinkEntity( self );
+ self->r.contents = 0; //stop collisions...
+ trap_LinkEntity( self ); //...requires a relink
}
@@ -1746,7 +1735,6 @@ void HSpawn_Blast( gentity_t *self )
self->s.modelindex = 0; //don't draw the model once its destroyed
G_AddEvent( self, EV_BUILDABLE_EXPLOSION, DirToByte( dir ) );
- self->r.contents = CONTENTS_TRIGGER;
self->timestamp = level.time;
//do some radius damage
@@ -1755,6 +1743,9 @@ void HSpawn_Blast( gentity_t *self )
self->think = freeBuildable;
self->nextthink = level.time + 100;
+
+ self->r.contents = 0; //stop collisions...
+ trap_LinkEntity( self ); //...requires a relink
}
@@ -1783,8 +1774,6 @@ void HSpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
else if( self->s.modelindex == BA_H_SPAWN )
attacker->client->ps.persistant[ PERS_CREDIT ] += HSPAWN_VALUE;
}
-
- trap_LinkEntity( self );
}
/*