diff options
-rw-r--r-- | src/cgame/cg_event.c | 14 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 8 | ||||
-rw-r--r-- | src/game/g_active.c | 2 | ||||
-rw-r--r-- | src/game/g_buildable.c | 2 | ||||
-rw-r--r-- | src/game/g_cmds.c | 2 | ||||
-rw-r--r-- | src/game/g_maprotation.c | 34 |
6 files changed, 46 insertions, 16 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 07bcea9f..613c7ab3 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -39,8 +39,8 @@ static void CG_Obituary( entityState_t *ent ) char *message2; const char *targetInfo; const char *attackerInfo; - char targetName[ 32 ]; - char attackerName[ 32 ]; + char targetName[ MAX_NAME_LENGTH ]; + char attackerName[ MAX_NAME_LENGTH ]; char className[ 64 ]; gender_t gender; clientInfo_t *ci; @@ -72,8 +72,7 @@ static void CG_Obituary( entityState_t *ent ) if( !targetInfo ) return; - Q_strncpyz( targetName, Info_ValueForKey( targetInfo, "n" ), sizeof( targetName ) - 2 ); - strcat( targetName, S_COLOR_WHITE ); + Q_strncpyz( targetName, Info_ValueForKey( targetInfo, "n" ), sizeof( targetName )); message2 = ""; @@ -182,7 +181,7 @@ static void CG_Obituary( entityState_t *ent ) if( message ) { - CG_Printf( "%s %s.\n", targetName, message ); + CG_Printf( "%s" S_COLOR_WHITE " %s.\n", targetName, message ); return; } @@ -194,8 +193,7 @@ static void CG_Obituary( entityState_t *ent ) } else { - Q_strncpyz( attackerName, Info_ValueForKey( attackerInfo, "n" ), sizeof( attackerName ) - 2); - strcat( attackerName, S_COLOR_WHITE ); + Q_strncpyz( attackerName, Info_ValueForKey( attackerInfo, "n" ), sizeof( attackerName )); // check for kill messages about the current clientNum if( target == cg.snap->ps.clientNum ) Q_strncpyz( cg.killerName, attackerName, sizeof( cg.killerName ) ); @@ -329,7 +327,7 @@ static void CG_Obituary( entityState_t *ent ) if( message ) { - CG_Printf( "%s %s %s%s%s\n", + CG_Printf( "%s" S_COLOR_WHITE " %s %s%s%s\n", targetName, message, ( teamKill ) ? S_COLOR_RED "TEAMMATE " S_COLOR_WHITE : "", attackerName, message2 ); diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index f247d1b4..a3f05b74 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -3212,11 +3212,11 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) //force angles to -180 <= x <= 180 for( i = 0; i < 3; i++ ) { - while( tempang[ i ] > 180 ) - tempang[ i ] -= 360; + while( tempang[ i ] > 180.0f ) + tempang[ i ] -= 360.0f; - while( tempang[ i ] < 180 ) - tempang[ i ] += 360; + while( tempang[ i ] < -180.0f ) + tempang[ i ] += 360.0f; } //actually set the viewangles diff --git a/src/game/g_active.c b/src/game/g_active.c index 953b939f..7ba6bd88 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -788,7 +788,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) } else if( boostEntity->s.eType == ET_BUILDABLE && boostEntity->s.modelindex == BA_A_BOOSTER && - boostEntity->spawned ) + boostEntity->spawned && boostEntity->health > 0) { modifier = BOOSTER_REGEN_MOD; break; diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 3c328a81..45b23339 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1355,7 +1355,7 @@ void ABooster_Touch( gentity_t *self, gentity_t *other, trace_t *trace ) { gclient_t *client = other->client; - if( !self->spawned ) + if( !self->spawned || self->health <= 0 ) return; if( !G_FindOvermind( self ) ) diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index e383635b..dac9a9a5 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -880,7 +880,7 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText ) break; } - Q_strncpyz( text, chatText, sizeof( text ) ); + Com_sprintf( text, sizeof( text ), "%s^7", chatText ); if( target ) { diff --git a/src/game/g_maprotation.c b/src/game/g_maprotation.c index c3a8d8a6..b1972258 100644 --- a/src/game/g_maprotation.c +++ b/src/game/g_maprotation.c @@ -29,6 +29,26 @@ static mapRotations_t mapRotations; /* =============== +G_MapExists + +Check if a map exists +=============== +*/ +static qboolean G_MapExists( char *name ) +{ + fileHandle_t f; + + if( trap_FS_FOpenFile( va( "maps/%s.bsp", name ), &f, FS_READ ) > 0 ) + { + trap_FS_FCloseFile( f ); + return qtrue; + } + else + return qfalse; +} + +/* +=============== G_ParseCommandSection Parse a map rotation command section @@ -141,6 +161,12 @@ static qboolean G_ParseMapRotation( mapRotation_t *mr, char **text_p ) mrc = &mre->conditions[ mre->numConditions ]; mrc->unconditional = qtrue; + + if( !G_MapExists( token ) ) + { + G_Printf( S_COLOR_RED "ERROR: map \"%s\" doesn't exist\n", token ); + return qfalse; + } Q_strncpyz( mrc->dest, token, sizeof( mrc->dest ) ); if( mre->numConditions == MAX_MAP_ROTATION_CONDS ) @@ -251,6 +277,12 @@ static qboolean G_ParseMapRotation( mapRotation_t *mr, char **text_p ) else mr->numMaps++; + if( !G_MapExists( token ) ) + { + G_Printf( S_COLOR_RED "ERROR: map \"%s\" doesn't exist\n", token ); + return qfalse; + } + Q_strncpyz( mre->name, token, sizeof( mre->name ) ); mnSet = qtrue; } @@ -327,7 +359,7 @@ static qboolean G_ParseMapRotationFile( const char *fileName ) return qfalse; } - //start parsing particle systems again + //start parsing map rotations again mrNameSet = qfalse; if( mapRotations.numRotations == MAX_MAP_ROTATIONS ) |