diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_local.h | 8 | ||||
-rw-r--r-- | src/cgame/cg_players.c | 28 | ||||
-rw-r--r-- | src/game/bg_misc.c | 10 | ||||
-rw-r--r-- | src/game/bg_public.h | 2 | ||||
-rw-r--r-- | src/game/g_active.c | 2 | ||||
-rw-r--r-- | src/game/g_buildable.c | 32 | ||||
-rw-r--r-- | src/game/g_cmds.c | 38 | ||||
-rw-r--r-- | src/game/g_local.h | 9 | ||||
-rw-r--r-- | src/game/g_maprotation.c | 13 | ||||
-rw-r--r-- | src/game/g_misc.c | 5 |
10 files changed, 91 insertions, 56 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 72ed253f..6d062b1d 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -123,17 +123,17 @@ typedef enum } jetPackState_t; //particle system stuff -#define MAX_SHADER_FRAMES 64 +#define MAX_SHADER_FRAMES 32 #define MAX_EJECTORS_PER_SYSTEM 4 #define MAX_PARTICLES_PER_EJECTOR 4 -#define MAX_BASEPARTICLE_SYSTEMS 512 +#define MAX_BASEPARTICLE_SYSTEMS 192 #define MAX_BASEPARTICLE_EJECTORS MAX_BASEPARTICLE_SYSTEMS*MAX_EJECTORS_PER_SYSTEM #define MAX_BASEPARTICLES MAX_BASEPARTICLE_EJECTORS*MAX_PARTICLES_PER_EJECTOR -#define MAX_PARTICLE_SYSTEMS 64 +#define MAX_PARTICLE_SYSTEMS 48 #define MAX_PARTICLE_EJECTORS MAX_PARTICLE_SYSTEMS*MAX_EJECTORS_PER_SYSTEM -#define MAX_PARTICLES MAX_PARTICLE_EJECTORS*8 +#define MAX_PARTICLES MAX_PARTICLE_EJECTORS*5 #define PARTICLES_INFINITE -1 #define PARTICLES_SAME_AS_INITIAL -2 diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index 9dd06cd7..e5e2ec28 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -1396,9 +1396,10 @@ static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso ) int held, active; refEntity_t jetpack; refEntity_t flash; + entityState_t *es = ¢->currentState; - held = cent->currentState.modelindex; - active = cent->currentState.modelindex2; + held = es->modelindex; + active = es->modelindex2; if( held & ( 1 << UP_JETPACK ) ) { @@ -1419,7 +1420,7 @@ static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso ) if( active & ( 1 << UP_JETPACK ) ) { - if( cent->currentState.pos.trDelta[ 2 ] > 10.0f ) + if( es->pos.trDelta[ 2 ] > 10.0f ) { if( cent->jetPackState != JPS_ASCENDING ) { @@ -1433,7 +1434,7 @@ static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso ) trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin, cgs.media.jetpackAscendSound ); } - else if( cent->currentState.pos.trDelta[ 2 ] < -10.0f ) + else if( es->pos.trDelta[ 2 ] < -10.0f ) { if( cent->jetPackState != JPS_DESCENDING ) { @@ -1496,6 +1497,25 @@ static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso ) cent->jetPackState = JPS_OFF; cent->jetPackPS = NULL; } + + if( es->eFlags & EF_BLOBLOCKED ) + { + vec3_t temp, origin, up = { 0.0f, 0.0f, 1.0f }; + trace_t tr; + float size; + + VectorCopy( es->pos.trBase, temp ); + temp[ 2 ] -= 4096.0f; + + CG_Trace( &tr, es->pos.trBase, NULL, NULL, temp, es->number, MASK_SOLID ); + VectorCopy( tr.endpos, origin ); + + size = 32.0f; + + if( size > 0.0f ) + CG_ImpactMark( cgs.media.creepShader, origin, up, + 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, qfalse, size, qtrue ); + } } diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 643b2433..4eb0e9d9 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -4360,6 +4360,11 @@ void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean else s->eFlags &= ~EF_DEAD; + if( ps->stats[ STAT_STATE ] & SS_BLOBLOCKED ) + s->eFlags |= EF_BLOBLOCKED; + else + s->eFlags &= ~EF_BLOBLOCKED; + if( ps->externalEvent ) { s->event = ps->externalEvent; @@ -4464,6 +4469,11 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s else s->eFlags &= ~EF_DEAD; + if( ps->stats[ STAT_STATE ] & SS_BLOBLOCKED ) + s->eFlags |= EF_BLOBLOCKED; + else + s->eFlags &= ~EF_BLOBLOCKED; + if( ps->externalEvent ) { s->event = ps->externalEvent; diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 84184b2c..d1216852 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -282,7 +282,7 @@ typedef enum #define EF_CONNECTION 0x00004000 // draw a connection trouble sprite #define EF_VOTED 0x00008000 // already cast a vote #define EF_TEAMVOTED 0x00010000 // already cast a vote -#define EF_OVERDRAW_OFF 0x00020000 // TA: disable overdraw protection on sprites +#define EF_BLOBLOCKED 0x00020000 // TA: caught by a trapper #define EF_REAL_LIGHT 0x00040000 // TA: light sprites according to ambient light typedef enum diff --git a/src/game/g_active.c b/src/game/g_active.c index 8f1971b7..08a598a3 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -1112,7 +1112,7 @@ void ClientThink_real( gentity_t *ent ) //TA: look for object infront of player AngleVectors( client->ps.viewangles, view, NULL, NULL ); - VectorMA( client->ps.origin, 200, view, point ); + VectorMA( client->ps.origin, USE_OBJECT_RANGE, view, point ); trap_Trace( &trace, client->ps.origin, NULL, NULL, point, ent->s.number, MASK_SHOT ); traceEnt = &g_entities[ trace.entityNum ]; diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 84e25106..4eadaf12 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1893,6 +1893,38 @@ void HSpawn_Think( gentity_t *self ) /* +=============== +G_BuildableRange + +Check whether a point is within some range of a type of buildable +=============== +*/ +qboolean G_BuildableRange( vec3_t origin, float r, buildable_t buildable ) +{ + int entityList[ MAX_GENTITIES ]; + vec3_t range; + vec3_t mins, maxs, dir; + int i, num; + gentity_t *ent; + + VectorSet( range, r, r, r ); + VectorAdd( origin, range, maxs ); + VectorSubtract( origin, range, mins ); + + num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); + for( i = 0; i < num; i++ ) + { + ent = &g_entities[ entityList[ i ] ]; + + if( ent->s.eType == ET_BUILDABLE && ent->s.modelindex == buildable && ent->spawned ) + return qtrue; + } + + return qfalse; +} + + +/* ================ G_itemFits diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 9342c789..137a5f67 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -932,7 +932,6 @@ void Cmd_Class_f( gentity_t *ent ) int clientNum; gentity_t *spawn; vec3_t spawn_origin, spawn_angles; - vec3_t distance; vec3_t up = { 0.0f, 0.0f, 1.0f }; int length = 4096; int i; @@ -1229,7 +1228,6 @@ void Cmd_ToggleItem_f( gentity_t *ent ) trap_SendServerCommand( ent-g_entities, va( "print \"You don't have the %s\n\"", s ) ); } - /* ================= Cmd_Buy_f @@ -1238,10 +1236,7 @@ Cmd_Buy_f void Cmd_Buy_f( gentity_t *ent ) { char s[ MAX_TOKEN_CHARS ]; - vec3_t distance; int i; - gentity_t *armouryEntity; - qboolean nearArmoury = qfalse; int weapon, upgrade, numItems = 0; int quan, clips, maxClips; @@ -1263,21 +1258,8 @@ void Cmd_Buy_f( gentity_t *ent ) if( ent->client->pers.teamSelection != PTE_HUMANS ) return; - for ( i = 1, armouryEntity = g_entities + i; i < level.num_entities; i++, armouryEntity++ ) - { - if( armouryEntity->s.eType != ET_BUILDABLE ) - continue; - - if( armouryEntity->s.modelindex == BA_H_ARMOURY && armouryEntity->spawned ) - { - VectorSubtract( ent->s.pos.trBase, armouryEntity->s.origin, distance ); - if( VectorLength( distance ) <= 100 ) - nearArmoury = qtrue; - } - } - //no armoury nearby - if( !nearArmoury ) + if( !G_BuildableRange( ent->client->ps.origin, 100, BA_H_ARMOURY ) ) { trap_SendServerCommand( ent-g_entities, va( "print \"You must be near an armoury\n\"" ) ); return; @@ -1464,10 +1446,7 @@ Cmd_Sell_f void Cmd_Sell_f( gentity_t *ent ) { char s[ MAX_TOKEN_CHARS ]; - vec3_t distance; int i; - gentity_t *armouryEntity; - qboolean nearArmoury = qfalse; int weapon, upgrade; int quan, clips, maxClips; @@ -1476,22 +1455,9 @@ void Cmd_Sell_f( gentity_t *ent ) //aliens don't sell stuff if( ent->client->pers.teamSelection != PTE_HUMANS ) return; - - for ( i = 1, armouryEntity = g_entities + i; i < level.num_entities; i++, armouryEntity++ ) - { - if( armouryEntity->s.eType != ET_BUILDABLE ) - continue; - - if( armouryEntity->s.modelindex == BA_H_ARMOURY && armouryEntity->spawned ) - { - VectorSubtract( ent->s.pos.trBase, armouryEntity->s.origin, distance ); - if( VectorLength( distance ) <= 100 ) - nearArmoury = qtrue; - } - } //no armoury nearby - if( !nearArmoury ) + if( !G_BuildableRange( ent->client->ps.origin, 100, BA_H_ARMOURY ) ) { trap_SendServerCommand( ent-g_entities, va( "print \"You must be near an armoury\n\"" ) ); return; diff --git a/src/game/g_local.h b/src/game/g_local.h index c045c275..cba54933 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -386,7 +386,7 @@ struct gclient_s }; #define MAX_LOCDAMAGE_TEXT 8192 -#define MAX_LOCDAMAGE_REGIONS 32 +#define MAX_LOCDAMAGE_REGIONS 16 //TA: store locational damage regions typedef struct damageRegion_s @@ -400,7 +400,7 @@ typedef struct damageRegion_s } damageRegion_t; #define MAX_ARMOUR_TEXT 8192 -#define MAX_ARMOUR_REGIONS 32 +#define MAX_ARMOUR_REGIONS 16 //TA: store locational armour regions typedef struct armourRegion_s @@ -574,6 +574,7 @@ qboolean AHovel_Blocked( vec3_t srcAngles, vec3_t srcOrigin, vec3_t nor vec3_t mins, vec3_t maxs, int entityNum, vec3_t newOrigin, vec3_t newAngles ); +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 ); qboolean G_ValidateBuild( gentity_t *ent, buildable_t buildable ); @@ -780,7 +781,7 @@ void G_WriteSessionData( void ); // g_maprotation.c // #define MAX_MAP_ROTATIONS 16 -#define MAX_MAP_ROTATION_MAPS 256 +#define MAX_MAP_ROTATION_MAPS 32 #define MAX_MAP_COMMANDS 16 #define NOT_ROTATING -1 @@ -789,7 +790,7 @@ typedef struct mapRotationEntry_s { char name[ MAX_QPATH ]; - char postCmds[ MAX_TOKEN_CHARS ][ MAX_MAP_COMMANDS ]; + char postCmds[ MAX_QPATH ][ MAX_MAP_COMMANDS ]; int numCmds; } mapRotationEntry_t; diff --git a/src/game/g_maprotation.c b/src/game/g_maprotation.c index f94b07cf..e9039346 100644 --- a/src/game/g_maprotation.c +++ b/src/game/g_maprotation.c @@ -245,22 +245,29 @@ void G_PrintRotations( void ) { int i, j, k; + G_Printf( "Map rotations as parsed:\n\n" ); + for( i = 0; i < mapRotations.numRotations; i++ ) { - G_Printf( S_COLOR_CYAN "rotation: %s\n", mapRotations.rotations[ i ].name ); + G_Printf( "rotation: %s\n{\n", mapRotations.rotations[ i ].name ); for( j = 0; j < mapRotations.rotations[ i ].numMaps; j++ ) { - G_Printf( S_COLOR_CYAN " map: %s\n", mapRotations.rotations[ i ].maps[ j ].name ); + G_Printf( " map: %s\n {\n", mapRotations.rotations[ i ].maps[ j ].name ); for( k = 0; k < mapRotations.rotations[ i ].maps[ j ].numCmds; k++ ) { - G_Printf( S_COLOR_CYAN " command: %s\n", + G_Printf( " command: %s\n", mapRotations.rotations[ i ].maps[ j ].postCmds[ k ] ); } + + G_Printf( " }\n" ); } + + G_Printf( "}\n" ); } + G_Printf( "Total memory used: %d bytes\n", sizeof( mapRotations ) ); } /* diff --git a/src/game/g_misc.c b/src/game/g_misc.c index 3249fd0c..21c918d0 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -290,8 +290,8 @@ void SP_misc_spriter( gentity_t *self ) //add the shader to the client precache list self->s.weapon = G_ShaderIndex( self->targetShaderName ); - if( self->spawnflags & 1 ) - self->s.eFlags |= EF_OVERDRAW_OFF; +/* if( self->spawnflags & 1 ) + self->s.eFlags |= EF_OVERDRAW_OFF;*/ if( self->spawnflags & ( 1 << 1 ) ) self->s.eFlags |= EF_REAL_LIGHT; if( self->spawnflags & ( 1 << 2 ) ) @@ -332,7 +332,6 @@ void SP_misc_particle_system( gentity_t *self ) G_SpawnString( "psName", "", &s ); - G_Printf( S_COLOR_GREEN "psName: %s\n", s ); //add the particle system to the client precache list self->s.modelindex = G_ParticleSystemIndex( s ); |