diff options
author | Tim Angus <tim@ngus.net> | 2005-07-30 20:39:35 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2005-07-30 20:39:35 +0000 |
commit | b673cb6f3dd2014c4437d62a3b82106b5aec750b (patch) | |
tree | 5c5572d9c12231a068e6ea5149b458abd14583ef | |
parent | 34ef13ee1769a3ec5fd6f93394f8903c9f5570ea (diff) |
* Trapper targetting bug should be fixed/occur less frequently
* Free kill timer is no longer reset when spawning
* Removed loading of sprites/plasma1.tga
-rw-r--r-- | src/cgame/cg_local.h | 2 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 2 | ||||
-rw-r--r-- | src/game/g_active.c | 8 | ||||
-rw-r--r-- | src/game/g_buildable.c | 26 | ||||
-rw-r--r-- | src/game/g_client.c | 1 |
5 files changed, 14 insertions, 25 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 101aa8ed..821972d9 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1106,8 +1106,6 @@ typedef struct qhandle_t smokePuffShader; qhandle_t smokePuffRageProShader; qhandle_t shotgunSmokePuffShader; - qhandle_t plasmaBallShader; - qhandle_t blasterShader; qhandle_t waterBubbleShader; qhandle_t bloodTrailShader; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 2510fc17..056fd76f 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -763,8 +763,6 @@ static void CG_RegisterGraphics( void ) cgs.media.smokePuffShader = trap_R_RegisterShader( "smokePuff" ); cgs.media.smokePuffRageProShader = trap_R_RegisterShader( "smokePuffRagePro" ); cgs.media.shotgunSmokePuffShader = trap_R_RegisterShader( "shotgunSmokePuff" ); - cgs.media.blasterShader = trap_R_RegisterShader( "sprites/plasma1" ); - cgs.media.plasmaBallShader = trap_R_RegisterShader( "sprites/plasma1" ); cgs.media.bloodTrailShader = trap_R_RegisterShader( "bloodTrail" ); cgs.media.connectionShader = trap_R_RegisterShader( "disconnected" ); diff --git a/src/game/g_active.c b/src/game/g_active.c index 492ab015..3ae9c561 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -1367,13 +1367,9 @@ void ClientThink_real( gentity_t *ent ) if( ent->client->lastKillTime + FREEKILL_PERIOD < level.time ) { if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) - { - G_AddCreditToClient( ent->client, FREEKILL_ALIEN, qtrue ); - } + G_AddCreditToClient( ent->client, FREEKILL_ALIEN, qtrue ); else if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) - { - G_AddCreditToClient( ent->client, FREEKILL_HUMAN, qtrue ); - } + G_AddCreditToClient( ent->client, FREEKILL_HUMAN, qtrue ); ent->client->lastKillTime = level.time; } diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 6245e7ac..92599d38 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1285,7 +1285,7 @@ ADef_fireonemeny Used by ADef2_Think to fire at enemy ================ */ -void ADef_FireOnEnemy( gentity_t *self, int firespeed ) +void ADef_FireOnEnemy( gentity_t *self, int firespeed, float range ) { vec3_t dirToTarget; vec3_t halfAcceleration, thirdJerk; @@ -1295,24 +1295,22 @@ void ADef_FireOnEnemy( gentity_t *self, int firespeed ) VectorScale( self->enemy->acceleration, 1.0f / 2.0f, halfAcceleration ); VectorScale( self->enemy->jerk, 1.0f / 3.0f, thirdJerk ); - //O( time ) - worst case O( time ) = 250 iterations + //O( time ) - worst case O( time ) = ( range * 1000 ) / speed for( i = 0; (float)( i * LOCKBLOB_SPEED ) / 1000.0f < distanceToTarget; i++ ) { float time = (float)i / 1000.0f; - if( i > 250 ) + if( i > ( ( (float)range * 1000.0f ) / LOCKBLOB_SPEED ) ) { + VectorSubtract( self->enemy->s.pos.trBase, self->s.pos.trBase, dirToTarget ); + distanceToTarget = VectorLength( dirToTarget ); + G_LogPrintf( "ADef_FireOnEnemy failed.\n" - " %dth iteration\n" - " enemy location: %v\n" - " enemy accleration: %v\n" - " enemy jerk: %v\n" - " base location: %v\n", - i, - self->enemy->s.pos.trBase, - self->enemy->acceleration, - self->enemy->jerk, - self->s.pos.trBase ); + " %dth iteration\n enemy location: %v\n" + " enemy accleration: %v\n enemy jerk: %v\n" + " base location: %v\n distanceToTarget: %f\n", + i, self->enemy->s.pos.trBase, self->enemy->acceleration, + self->enemy->jerk, self->s.pos.trBase, distanceToTarget ); return; } @@ -1443,7 +1441,7 @@ void ATrapper_Think( gentity_t *self ) //if we are pointing at our target and we can fire shoot it if( self->count < level.time ) - ADef_FireOnEnemy( self, firespeed ); + ADef_FireOnEnemy( self, firespeed, range ); } } diff --git a/src/game/g_client.c b/src/game/g_client.c index 23fca525..5ca073b8 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1477,7 +1477,6 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles client->ps.pm_time = 100; client->respawnTime = level.time; - client->lastKillTime = level.time; client->inactivityTime = level.time + g_inactivity.integer * 1000; client->latched_buttons = 0; |