diff options
Diffstat (limited to 'src/game')
-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 |
5 files changed, 40 insertions, 8 deletions
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 ) |