diff options
author | /dev/humancontroller <devhc@example.com> | 2015-06-08 14:45:35 +0200 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-03-09 13:51:15 +0100 |
commit | 0b0e4c0db6886b98fcd593c3ca496e75c24b8a1e (patch) | |
tree | 7a353751f1d2a713d4140fda8afb21e881d453f9 | |
parent | 639639c22d45eda949809446e4c29e0ed4c7d290 (diff) |
fix up G_MapExists(), and use it more
-rw-r--r-- | src/game/g_admin.c | 2 | ||||
-rw-r--r-- | src/game/g_local.h | 2 | ||||
-rw-r--r-- | src/game/g_maprotation.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 2d6aeaba..24330aa2 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -2044,7 +2044,7 @@ qboolean G_admin_changemap( gentity_t *ent ) trap_Argv( 1, map, sizeof( map ) ); - if( !trap_FS_FOpenFile( va( "maps/%s.bsp", map ), NULL, FS_READ ) ) + if( !G_MapExists( map ) ) { ADMP( va( "^3changemap: ^7invalid map name '%s'\n", map ) ); return qfalse; diff --git a/src/game/g_local.h b/src/game/g_local.h index 693b5bb1..262eb138 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -1071,7 +1071,7 @@ void G_StopMapRotation( void ); qboolean G_MapRotationActive( void ); void G_InitMapRotations( void ); void G_ShutdownMapRotations( void ); -qboolean G_MapExists( char *name ); +qboolean G_MapExists( const char *name ); void G_ClearRotationStack( void ); void G_PerformMapRestart( void ); void G_PerformMapChange( const char *map ); diff --git a/src/game/g_maprotation.c b/src/game/g_maprotation.c index e6d773e8..a25c9749 100644 --- a/src/game/g_maprotation.c +++ b/src/game/g_maprotation.c @@ -118,9 +118,9 @@ G_MapExists Check if a map exists =============== */ -qboolean G_MapExists( char *name ) +qboolean G_MapExists( const char *name ) { - return trap_FS_FOpenFile( va( "maps/%s.bsp", name ), NULL, FS_READ ); + return trap_FS_FOpenFile( va( "maps/%s.bsp", name ), NULL, FS_READ ) > 0; } /* |