summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/g_admin.c2
-rw-r--r--src/game/g_local.h2
-rw-r--r--src/game/g_maprotation.c4
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;
}
/*