diff options
author | Tim Angus <tim@ngus.net> | 2004-01-25 04:52:23 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2004-01-25 04:52:23 +0000 |
commit | 4bb84115f10466cf6aa9295830f37ff20238dd6c (patch) | |
tree | 846ef6822fcf1462ae139f4ee502c917193670a3 /src | |
parent | 7dcfcac2a6de7e2976990b8620f660ad7af959a9 (diff) |
* Fixed two serious particle system bugs
* Created a general buildable think function
* Fixed the post armoury weapon selection for real
* Balance tweaks
* A pile of other crap
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_ents.c | 16 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 10 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 2 | ||||
-rw-r--r-- | src/cgame/cg_particles.c | 70 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 5 | ||||
-rw-r--r-- | src/game/bg_misc.c | 6 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 22 | ||||
-rw-r--r-- | src/game/g_buildable.c | 64 | ||||
-rw-r--r-- | src/game/g_client.c | 6 | ||||
-rw-r--r-- | src/game/g_cmds.c | 9 | ||||
-rw-r--r-- | src/game/g_combat.c | 3 | ||||
-rw-r--r-- | src/game/g_local.h | 1 | ||||
-rw-r--r-- | src/game/g_main.c | 8 | ||||
-rw-r--r-- | src/game/g_physics.c | 46 | ||||
-rw-r--r-- | src/game/g_spawn.c | 8 | ||||
-rw-r--r-- | src/game/g_weapon.c | 6 | ||||
-rw-r--r-- | src/game/tremulous.h | 22 | ||||
-rw-r--r-- | src/ui/ui_main.c | 2 | ||||
-rw-r--r-- | src/ui/ui_shared.c | 2 |
19 files changed, 175 insertions, 133 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index 278309b8..09ec1bfe 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -1058,12 +1058,16 @@ void CG_AddPacketEntities( void ) { VectorCopy( cent->lerpOrigin, cg.ep.alienBuildablePos[ cg.ep.numAlienBuildables ] ); cg.ep.alienBuildableTimes[ cg.ep.numAlienBuildables ] = cent->miscTime; - cg.ep.numAlienBuildables++; + + if( cg.ep.numAlienBuildables < MAX_GENTITIES ) + cg.ep.numAlienBuildables++; } else if( cent->currentState.modelindex2 == BIT_HUMANS ) { VectorCopy( cent->lerpOrigin, cg.ep.humanBuildablePos[ cg.ep.numHumanBuildables ] ); - cg.ep.numHumanBuildables++; + + if( cg.ep.numHumanBuildables < MAX_GENTITIES ) + cg.ep.numHumanBuildables++; } } else if( cent->currentState.eType == ET_PLAYER ) @@ -1073,12 +1077,16 @@ void CG_AddPacketEntities( void ) if( team == PTE_ALIENS ) { VectorCopy( cent->lerpOrigin, cg.ep.alienClientPos[ cg.ep.numAlienClients ] ); - cg.ep.numAlienClients++; + + if( cg.ep.numAlienClients < MAX_CLIENTS ) + cg.ep.numAlienClients++; } else if( team == PTE_HUMANS ) { VectorCopy( cent->lerpOrigin, cg.ep.humanClientPos[ cg.ep.numHumanClients ] ); - cg.ep.numHumanClients++; + + if( cg.ep.numHumanClients < MAX_CLIENTS ) + cg.ep.numHumanClients++; } } } diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 4c5f36a3..62b32ea4 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -303,9 +303,9 @@ typedef struct particleSystem_s psAttachment_t attachment; qboolean attached; //is the particle system attached to anything - qboolean enabled; //necessary? - qboolean valid; + qboolean lazyRemove; //mark this system for later removal + } particleSystem_t; @@ -769,11 +769,11 @@ typedef struct //TA: typedef struct { - vec3_t alienBuildablePos[ BA_NUM_BUILDABLES ]; - int alienBuildableTimes[ BA_NUM_BUILDABLES ]; + vec3_t alienBuildablePos[ MAX_GENTITIES ]; + int alienBuildableTimes[ MAX_GENTITIES ]; int numAlienBuildables; - vec3_t humanBuildablePos[ BA_NUM_BUILDABLES ]; + vec3_t humanBuildablePos[ MAX_GENTITIES ]; int numHumanBuildables; vec3_t alienClientPos[ MAX_CLIENTS ]; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index baa1146a..cd6a9333 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -721,7 +721,6 @@ static void CG_RegisterGraphics( void ) //TA: extra stuff cgs.media.explosionShader = trap_R_RegisterShader( "grenadeExplosion" ); cgs.media.greenBloodTrailShader = trap_R_RegisterShader( "greenBloodTrail" ); - cgs.media.greenBloodExplosionShader = trap_R_RegisterShader( "greenBloodExplosion" ); cgs.media.greenBloodMarkShader = trap_R_RegisterShader( "greenBloodMark" ); cgs.media.explosionTrailShader = trap_R_RegisterShader( "explosionTrail" ); @@ -778,6 +777,7 @@ static void CG_RegisterGraphics( void ) cgs.media.balloonShader = trap_R_RegisterShader( "sprites/balloon3" ); cgs.media.bloodExplosionShader = trap_R_RegisterShader( "bloodExplosion" ); + cgs.media.greenBloodExplosionShader = trap_R_RegisterShader( "greenBloodExplosion" ); cgs.media.bulletFlashModel = trap_R_RegisterModel( "models/weaphits/bullet.md3" ); cgs.media.ringFlashModel = trap_R_RegisterModel( "models/weaphits/ring02.md3" ); diff --git a/src/cgame/cg_particles.c b/src/cgame/cg_particles.c index b3139bbf..28787bd0 100644 --- a/src/cgame/cg_particles.c +++ b/src/cgame/cg_particles.c @@ -100,6 +100,8 @@ static particle_t *CG_SpawnNewParticle( baseParticle_t *bp, particleEjector_t *p if( !p->valid ) { + memset( p, 0, sizeof( particle_t ) ); + //found a free slot p->class = bp; p->parent = pe; @@ -219,6 +221,7 @@ static particle_t *CG_SpawnNewParticle( baseParticle_t *bp, particleEjector_t *p p->lastEvalTime = cg.time; p->valid = qtrue; + break; } } @@ -258,28 +261,29 @@ static void CG_SpawnNewParticles( void ) bpe = particleEjectors[ i ].class; - while( pe->nextEjectionTime <= cg.time && - ( pe->count > 0 || pe->totalParticles == PARTICLES_INFINITE ) ) + //if this system is scheduled for removal don't make any new particles + if( !ps->lazyRemove ) { - for( j = 0; j < bpe->numParticles; j++ ) - CG_SpawnNewParticle( bpe->particles[ j ], pe ); - - if( pe->count > 0 ) - pe->count--; - - //calculate next ejection time - lerpFrac = 1.0 - ( (float)pe->count / (float)pe->totalParticles ); - pe->nextEjectionTime = cg.time + CG_RandomiseValue( - CG_LerpValues( pe->ejectPeriod.initial, - pe->ejectPeriod.final, - lerpFrac ), - pe->ejectPeriod.randFrac ); + while( pe->nextEjectionTime <= cg.time && + ( pe->count > 0 || pe->totalParticles == PARTICLES_INFINITE ) ) + { + for( j = 0; j < bpe->numParticles; j++ ) + CG_SpawnNewParticle( bpe->particles[ j ], pe ); + + if( pe->count > 0 ) + pe->count--; + + //calculate next ejection time + lerpFrac = 1.0 - ( (float)pe->count / (float)pe->totalParticles ); + pe->nextEjectionTime = cg.time + CG_RandomiseValue( + CG_LerpValues( pe->ejectPeriod.initial, + pe->ejectPeriod.final, + lerpFrac ), + pe->ejectPeriod.randFrac ); + } } - if( !pe->parent->valid ) - pe->valid = qfalse; - - if( pe->count == 0 ) + if( pe->count == 0 || ps->lazyRemove ) { count = 0; @@ -320,6 +324,8 @@ static particleEjector_t *CG_SpawnNewParticleEjector( baseParticleEjector_t *bpe if( !pe->valid ) { + memset( pe, 0, sizeof( particleEjector_t ) ); + //found a free slot pe->class = bpe; pe->parent = ps; @@ -334,6 +340,10 @@ static particleEjector_t *CG_SpawnNewParticleEjector( baseParticleEjector_t *bpe (int)CG_RandomiseValue( (float)bpe->totalParticles, bpe->totalParticlesRandFrac ); pe->valid = qtrue; + + if( cg_debugParticles.integer >= 1 ) + CG_Printf( "PE %s created\n", ps->class->name ); + break; } } @@ -367,14 +377,17 @@ particleSystem_t *CG_SpawnNewParticleSystem( qhandle_t psHandle ) if( !ps->valid ) { + memset( ps, 0, sizeof( particleSystem_t ) ); + //found a free slot ps->class = bps; + ps->valid = qtrue; + ps->lazyRemove = qfalse; + for( j = 0; j < bps->numEjectors; j++ ) CG_SpawnNewParticleEjector( bps->ejectors[ j ], ps ); - ps->valid = qtrue; - if( cg_debugParticles.integer >= 1 ) CG_Printf( "PS %s created\n", bps->name ); @@ -1502,12 +1515,18 @@ qboolean CG_IsParticleSystemInfinite( particleSystem_t *ps ) int i; particleEjector_t *pe; - if( ps == NULL || !ps->valid ) + if( ps == NULL ) { CG_Printf( S_COLOR_YELLOW "WARNING: tried to test a NULL particle system\n" ); return qfalse; } + if( !ps->valid ) + { + CG_Printf( S_COLOR_YELLOW "WARNING: tried to test an invalid particle system\n" ); + return qfalse; + } + //don't bother checking already invalid systems if( !ps->valid ) return qfalse; @@ -1584,11 +1603,11 @@ static void CG_GarbageCollectParticleSystems( void ) if( ps->attachment.centValid && ps->attachment.centNum != cg.clientNum ) { if( !cg_entities[ ps->attachment.centNum ].valid ) - ps->valid = qfalse; + ps->lazyRemove = qtrue; } if( cg_debugParticles.integer >= 1 && !ps->valid ) - CG_Printf( "PS garbage collected\n" ); + CG_Printf( "PS %s garbage collected\n", ps->class->name ); } } @@ -1738,9 +1757,6 @@ static void CG_EvaluateParticlePhysics( particle_t *p ) if( ( trap_CM_PointContents( trace.endpos, 0 ) & CONTENTS_NODROP ) || ( bp->cullOnStartSolid && trace.startsolid ) || bp->bounceCull ) { - if( cg_debugParticles.integer >= 1 ) - CG_Printf( "Particle in CONTENTS_NODROP or trace.startsolid\n" ); - p->valid = qfalse; return; } diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index a6099915..3b24ee11 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -180,7 +180,7 @@ void CG_TeslaTrail( vec3_t start, vec3_t end, int srcENum, int destENum ) le->srcENum = srcENum; le->destENum = destENum; le->vOffset = 28; - le->maxRange = BG_FindRangeForBuildable( BA_H_TESLAGEN ); + le->maxRange = BG_FindRangeForBuildable( BA_H_TESLAGEN ) * M_SQRT2; VectorCopy( start, re->origin ); VectorCopy( end, re->oldorigin ); @@ -1654,7 +1654,8 @@ void CG_FireWeapon( centity_t *cent, weaponMode_t weaponMode ) if( wi->wim[ weaponMode ].muzzleParticleSystem ) { - if( !( cent->muzzlePS && CG_IsParticleSystemInfinite( cent->muzzlePS ) ) ) + if( !( CG_IsParticleSystemValid( ¢->muzzlePS ) && + CG_IsParticleSystemInfinite( cent->muzzlePS ) ) ) cent->muzzlePsTrigger = qtrue; } diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index ee3fdf7f..413ab89f 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -1776,14 +1776,14 @@ classAttributes_t bg_classList[ ] = "default", //char *skinname; 2.0f, //float shadowScale; "alien_general_hud", //char *hudname; - ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages + ( 1 << S3 ), //int stages { -30, -30, -20 }, //vec3_t mins; { 30, 30, 20 }, //vec3_t maxs; { 30, 30, 20 }, //vec3_t crouchmaxs; { -15, -15, -4 }, //vec3_t deadmins; { 15, 15, 4 }, //vec3_t deadmaxs; 0.0f, //float zOffset - 50, 50, //int viewheight, crouchviewheight; + 35, 35, //int viewheight, crouchviewheight; BMOFO_HEALTH, //int health; 0.0f, //float fallDamage; BMOFO_REGEN, //int regenRate; @@ -3794,7 +3794,7 @@ upgradeAttributes_t bg_upgrades[ ] = { UP_HELMET, //int upgradeNum; HELMET_PRICE, //int price; - ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages + ( 1 << S2 )|( 1 << S3 ), //int stages SLOT_HEAD, //int slots; "helmet", //char *upgradeName; "Helmet", //char *upgradeHumanName; diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 4f8fe643..bfc47a22 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -1955,10 +1955,10 @@ static void PM_GroundClimbTrace( void ) } } - if ( trace.fraction >= 1.0f ) + if( trace.fraction >= 1.0f ) { // if the trace didn't hit anything, we are in free fall - PM_GroundTraceMissed(); + PM_GroundTraceMissed( ); pml.groundPlane = qfalse; pml.walking = qfalse; pm->ps->eFlags &= ~EF_WALLCLIMB; @@ -1974,7 +1974,7 @@ static void PM_GroundClimbTrace( void ) pml.walking = qtrue; // hitting solid ground will end a waterjump - if (pm->ps->pm_flags & PMF_TIME_WATERJUMP) + if( pm->ps->pm_flags & PMF_TIME_WATERJUMP ) { pm->ps->pm_flags &= ~(PMF_TIME_WATERJUMP | PMF_TIME_LAND); pm->ps->pm_time = 0; @@ -2033,7 +2033,7 @@ static void PM_GroundTrace( void ) point[ 0 ] = pm->ps->origin[ 0 ]; point[ 1 ] = pm->ps->origin[ 1 ]; - point[ 2 ] = pm->ps->origin[ 2 ] - 0.25; + point[ 2 ] = pm->ps->origin[ 2 ] - 0.25f; pm->trace( &trace, pm->ps->origin, pm->mins, pm->maxs, point, pm->ps->clientNum, pm->tracemask ); @@ -2048,7 +2048,7 @@ static void PM_GroundTrace( void ) VectorCopy( refNormal, pm->ps->grapplePoint ); // if the trace didn't hit anything, we are in free fall - if( trace.fraction == 1.0 ) + if( trace.fraction == 1.0f ) { PM_GroundTraceMissed( ); pml.groundPlane = qfalse; @@ -2090,7 +2090,7 @@ static void PM_GroundTrace( void ) } // check if getting thrown off the ground - if( pm->ps->velocity[ 2 ] > 0 && DotProduct( pm->ps->velocity, trace.plane.normal ) > 10 ) + if( pm->ps->velocity[ 2 ] > 0.0f && DotProduct( pm->ps->velocity, trace.plane.normal ) > 10.0f ) { if( pm->debugLevel ) Com_Printf( "%i:kickoff\n", c_pmove ); @@ -2646,10 +2646,6 @@ static void PM_Weapon( void ) if( pm->ps->weaponTime > 0 ) pm->ps->weaponTime -= pml.msec; - //TA: if we haven't got the weapon - if( !BG_gotWeapon( pm->ps->weapon, pm->ps->stats ) && pm->ps->weapon != WP_NONE ) - PM_BeginWeaponChange( WP_NONE ); - // check for weapon change // can't change if weapon is firing, but can change // again if lowering or raising @@ -2683,6 +2679,7 @@ static void PM_Weapon( void ) else pm->ps->pm_flags &= ~PMF_USE_ITEM_HELD; + //something external thinks a weapon change is necessary if( pm->ps->weapon != pm->cmd.weapon && pm->ps->pm_flags & PMF_WEAPON_SWITCH ) { pm->ps->pm_flags &= ~PMF_WEAPON_SWITCH; @@ -3141,7 +3138,7 @@ PmoveSingle */ void trap_SnapVector( float *v ); -void PmoveSingle (pmove_t *pmove) +void PmoveSingle( pmove_t *pmove ) { int ammo, clips, maxclips; @@ -3158,9 +3155,8 @@ void PmoveSingle (pmove_t *pmove) pm->watertype = 0; pm->waterlevel = 0; - /*if ( pm->ps->stats[STAT_HEALTH] <= 0 ) { + if( pm->ps->stats[ STAT_HEALTH ] <= 0 ) pm->tracemask &= ~CONTENTS_BODY; // corpses can fly through bodies - }*/ // make sure walking button is clear if they are running, to avoid // proxy no-footsteps cheats diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 10662feb..e0b59fa5 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1653,6 +1653,12 @@ qboolean HMGTurret_CheckTarget( gentity_t *self, gentity_t *target, qboolean ign trace_t trace; gentity_t *traceEnt; + if( !target ) + return qfalse; + + if( !target->client ) + return qfalse; + if( target->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) return qfalse; @@ -1982,6 +1988,64 @@ void HSpawn_Think( gentity_t *self ) +/* +=============== +G_BuildableThink + +General think function for buildables +=============== +*/ +void G_BuildableThink( gentity_t *ent, int msec ) +{ + int bHealth = BG_FindHealthForBuildable( ent->s.modelindex ); + int bRegen = BG_FindRegenRateForBuildable( ent->s.modelindex ); + + //pack health, power and dcc + + //toggle spawned flag for buildables + if( !ent->spawned ) + { + if( ent->buildTime + BG_FindBuildTimeForBuildable( ent->s.modelindex ) < level.time ) + { + ent->takedamage = qtrue; + ent->spawned = qtrue; + } + } + + ent->s.generic1 = (int)( ( (float)ent->health / (float)bHealth ) * B_HEALTH_SCALE ); + + if( ent->s.generic1 < 0 ) + ent->s.generic1 = 0; + + if( ent->powered ) + ent->s.generic1 |= B_POWERED_TOGGLEBIT; + + if( ent->dcced ) + ent->s.generic1 |= B_DCCED_TOGGLEBIT; + + if( ent->spawned ) + ent->s.generic1 |= B_SPAWNED_TOGGLEBIT; + + ent->time1000 += msec; + + if( ent->time1000 >= 1000 ) + { + ent->time1000 -= 1000; + + //regenerate health + if( ent->health > 0 && ent->health < bHealth && bRegen ) + { + ent->health += bRegen; + + if( ent->health > bHealth ) + ent->health = bHealth; + } + } + + //fall back on normal physics routines + G_Physics( ent, msec ); +} + /* =============== diff --git a/src/game/g_client.c b/src/game/g_client.c index f6394d41..f2f83d63 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -649,12 +649,6 @@ void SpawnCorpse( gentity_t *ent ) body->takedamage = qfalse; - //make the make player entity disappear - ent->takedamage = qfalse; - ent->s.eType = ET_INVISIBLE; - ent->r.contents = 0; - ent->s.solid = 0; - ent->r.s.solid = 0; body->health = ent->health = ent->client->ps.stats[ STAT_HEALTH ]; ent->health = ent->client->ps.stats[ STAT_HEALTH ] = GIB_HEALTH - 1; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index c63eee1a..4144b28b 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1346,8 +1346,7 @@ void Cmd_Buy_f( gentity_t *ent ) //force a weapon change ent->client->ps.pm_flags |= PMF_WEAPON_SWITCH; - ent->client->ps.weapon = weapon; - trap_SendServerCommand( ent->client->ps.clientNum, va( "weaponswitch %d", weapon ) ); + trap_SendServerCommand( ent-g_entities, va( "weaponswitch %d", weapon ) ); //set build delay/pounce etc to 0 ent->client->ps.stats[ STAT_MISC ] = 0; @@ -1494,7 +1493,11 @@ void Cmd_Sell_f( gentity_t *ent ) //if we have this weapon selected, force a new selection if( weapon == ent->client->ps.weapon ) - G_AddEvent( ent, EV_NEXT_WEAPON, ent->client->ps.clientNum ); + { + //force a weapon change + ent->client->ps.pm_flags |= PMF_WEAPON_SWITCH; + trap_SendServerCommand( ent-g_entities, va( "weaponswitch %d", WP_BLASTER ) ); + } } else if( upgrade != UP_NONE ) { diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 265ee182..847d8988 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -297,8 +297,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int self->s.weapon = WP_NONE; /*self->s.powerups = 0;*/ //TA: class is encoded into powerups in trem - self->r.contents = CONTENTS_BODY; - //self->r.contents = CONTENTS_CORPSE; + self->r.contents = CONTENTS_CORPSE; self->s.angles[ PITCH ] = 0; self->s.angles[ ROLL ] = 0; diff --git a/src/game/g_local.h b/src/game/g_local.h index 9ca44a71..fef66751 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -576,6 +576,7 @@ typedef enum qboolean AHovel_Blocked( gentity_t *hovel, gentity_t *player, qboolean provideExit ); gentity_t *G_CheckSpawnPoint( vec3_t origin, vec3_t normal, buildable_t spawn, vec3_t spawnOrigin ); +void G_BuildableThink( gentity_t *ent, int msec ); qboolean G_BuildableRange( vec3_t origin, float r, buildable_t buildable ); itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance, vec3_t origin ); gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin, vec3_t angles ); diff --git a/src/game/g_main.c b/src/game/g_main.c index e6e981a3..9f77e610 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1606,7 +1606,13 @@ void G_RunFrame( int levelTime ) continue; } - if( ent->s.eType == ET_BUILDABLE || ent->s.eType == ET_CORPSE || ent->physicsObject ) + if( ent->s.eType == ET_BUILDABLE ) + { + G_BuildableThink( ent, msec ); + continue; + } + + if( ent->s.eType == ET_CORPSE || ent->physicsObject ) { G_Physics( ent, msec ); continue; diff --git a/src/game/g_physics.c b/src/game/g_physics.c index e5e69b19..a1183ad4 100644 --- a/src/game/g_physics.c +++ b/src/game/g_physics.c @@ -81,52 +81,6 @@ void G_Physics( gentity_t *ent, int msec ) trace_t tr; int contents; int mask; - int bHealth = BG_FindHealthForBuildable( ent->s.modelindex ); - int bRegen = BG_FindRegenRateForBuildable( ent->s.modelindex ); - - //pack health, power and dcc - if( ent->s.eType == ET_BUILDABLE ) - { - //toggle spawned flag for buildables - if( !ent->spawned ) - { - if( ent->buildTime + BG_FindBuildTimeForBuildable( ent->s.modelindex ) < level.time ) - { - ent->takedamage = qtrue; - ent->spawned = qtrue; - } - } - - ent->s.generic1 = (int)( ( (float)ent->health / (float)bHealth ) * B_HEALTH_SCALE ); - - if( ent->s.generic1 < 0 ) - ent->s.generic1 = 0; - - if( ent->powered ) - ent->s.generic1 |= B_POWERED_TOGGLEBIT; - - if( ent->dcced ) - ent->s.generic1 |= B_DCCED_TOGGLEBIT; - - if( ent->spawned ) - ent->s.generic1 |= B_SPAWNED_TOGGLEBIT; - - ent->time1000 += msec; - - if( ent->time1000 >= 1000 ) - { - ent->time1000 -= 1000; - - //regenerate health - if( ent->health < bHealth && bRegen ) - { - ent->health += bRegen; - - if( ent->health > bHealth ) - ent->health = bHealth; - } - } - } // if groundentity has been set to -1, it may have been pushed off an edge if( ent->s.groundEntityNum == -1 ) diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c index 00d618c3..71ecaed8 100644 --- a/src/game/g_spawn.c +++ b/src/game/g_spawn.c @@ -605,10 +605,10 @@ void SP_worldspawn( void ) G_SpawnString( "humanMaxStage", "2", &s ); trap_Cvar_Set( "g_humanMaxStage", s ); - G_SpawnString( "humanStage2Threshold", "50", &s ); + G_SpawnString( "humanStage2Threshold", "15", &s ); trap_Cvar_Set( "g_humanStage2Threshold", s ); - G_SpawnString( "humanStage3Threshold", "100", &s ); + G_SpawnString( "humanStage3Threshold", "30", &s ); trap_Cvar_Set( "g_humanStage3Threshold", s ); G_SpawnString( "alienBuildPoints", "1000", &s ); @@ -617,10 +617,10 @@ void SP_worldspawn( void ) G_SpawnString( "alienMaxStage", "2", &s ); trap_Cvar_Set( "g_alienMaxStage", s ); - G_SpawnString( "alienStage2Threshold", "50", &s ); + G_SpawnString( "alienStage2Threshold", "15", &s ); trap_Cvar_Set( "g_alienStage2Threshold", s ); - G_SpawnString( "alienStage3Threshold", "100", &s ); + G_SpawnString( "alienStage3Threshold", "30", &s ); trap_Cvar_Set( "g_alienStage3Threshold", s ); G_SpawnString( "enableDust", "0", &s ); diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index dc2c6b38..e5130a43 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -425,13 +425,13 @@ void painSawFire( gentity_t *ent ) VectorMA( muzzle, PAINSAW_RANGE, forward, end ); trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); - if ( tr.surfaceFlags & SURF_NOIMPACT ) + if( tr.surfaceFlags & SURF_NOIMPACT ) return; traceEnt = &g_entities[ tr.entityNum ]; // send blood impact - if ( traceEnt->takedamage && traceEnt->client ) + if( traceEnt->takedamage && traceEnt->client ) { tent = G_TempEntity( tr.endpos, EV_MISSILE_HIT ); tent->s.otherEntityNum = traceEnt->s.number; @@ -440,7 +440,7 @@ void painSawFire( gentity_t *ent ) tent->s.generic1 = ent->s.generic1; //weaponMode } - if ( traceEnt->takedamage ) + if( traceEnt->takedamage ) G_Damage( traceEnt, ent, ent, forward, tr.endpos, PAINSAW_DAMAGE, DAMAGE_NO_KNOCKBACK, MOD_PAINSAW ); } diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 9e9c0534..b8454759 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -22,7 +22,7 @@ * */ -#define ALIEN_WDMG_MODIFIER 1.0f +#define ALIEN_WDMG_MODIFIER 0.8f #define ADM(d) ((int)((float)d*ALIEN_WDMG_MODIFIER)) #define ABUILDER_BUILD_REPEAT 500 @@ -31,14 +31,14 @@ #define ABUILDER_CLAW_REPEAT 1000 #define ABUILDER_BASE_DELAY 9000 #define ABUILDER_ADV_DELAY 4000 -#define ABUILDER_BLOB_DMG ADM(20) +#define ABUILDER_BLOB_DMG ADM(5) #define ABUILDER_BLOB_REPEAT 1000 #define ABUILDER_BLOB_SPEED 800.0f #define ABUILDER_BLOB_SPEED_MOD 0.5f #define ABUILDER_BLOB_TIME 5000 #define SOLDIER_BITE_DMG ADM(60) -#define SOLDIER_BITE_RANGE 96.0f +#define SOLDIER_BITE_RANGE 64.0f #define SOLDIER_BITE_REPEAT 500 #define HYDRA_CLAW_DMG ADM(40) @@ -103,7 +103,7 @@ #define ALIEN_HLTH_MODIFIER 1.0f #define AHM(h) ((int)((float)h*ALIEN_HLTH_MODIFIER)) -#define ALIEN_VALUE_MODIFIER 3.0f +#define ALIEN_VALUE_MODIFIER 4.0f #define AVM(h) ((int)((float)h*ALIEN_VALUE_MODIFIER)) #define ABUILDER_SPEED 0.8f @@ -201,7 +201,7 @@ #define BARRICADE_BP 80 #define BARRICADE_BT 10000 -#define BARRICADE_HEALTH ABHM(500) +#define BARRICADE_HEALTH ABHM(350) #define BARRICADE_REGEN 15 #define BARRICADE_SPLASHDAMAGE 50 #define BARRICADE_SPLASHRADIUS 50 @@ -363,10 +363,10 @@ #define LCANNON_REPEAT 500 #define LCANNON_CHARGEREPEAT 1000 #define LCANNON_RELOAD 2000 -#define LCANNON_DAMAGE HDM(200) -#define LCANNON_SECONDARY_DAMAGE HDM(20) +#define LCANNON_DAMAGE HDM(500) +#define LCANNON_SECONDARY_DAMAGE HDM(50) #define LCANNON_SPEED 250 -#define LCANNON_CHARGE_TIME 2000 +#define LCANNON_CHARGE_TIME 1000 #define LASGUN_PRICE 200 #define LASGUN_AMMO 300 @@ -377,7 +377,7 @@ #define PAINSAW_PRICE 100 #define PAINSAW_REPEAT 75 #define PAINSAW_DAMAGE HDM(5) -#define PAINSAW_RANGE 32 +#define PAINSAW_RANGE 48.0f #define HBUILD_PRICE 0 #define HBUILD_REPEAT 1000 @@ -514,8 +514,8 @@ #define HUMAN_BACK_MODIFIER 0.7f #define HUMAN_SIDE_MODIFIER 0.8f -#define STAMINA_STOP_RESTORE 20 -#define STAMINA_WALK_RESTORE 10 +#define STAMINA_STOP_RESTORE 25 +#define STAMINA_WALK_RESTORE 15 #define STAMINA_SPRINT_TAKE 8 #define STAMINA_LARMOUR_TAKE 4 diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 7401d000..4fb2ecf3 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -3632,8 +3632,6 @@ static void UI_LoadTremAlienBuilds( ) uiInfo.tremAlienBuildCount++; } } - - uiInfo.tremAlienBuildIndex = 0; } /* diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index 90286152..008bd5c0 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -4418,7 +4418,9 @@ menuDef_t *Menus_ActivateByName(const char *p) { { if( m->items[ j ]->type == ITEM_TYPE_LISTBOX ) { + listBoxDef_t *listPtr = (listBoxDef_t*)m->items[ j ]->typeData; m->items[ j ]->cursorPos = 0; + listPtr->startPos = 0; DC->feederSelection( m->items[ j ]->special, 0 ); } } |