map command without any arguments prints current map name

This commit is contained in:
Daniel Gibson 2024-07-04 16:34:49 +02:00
parent 794d40a04c
commit 10eee1eb43

View file

@ -108,6 +108,13 @@ static void Session_Map_f( const idCmdArgs &args ) {
map = args.Argv(1);
if ( !map.Length() ) {
// DG: if the map command is called without any arguments, print the current map
// TODO: could check whether we're currently in a game, otherwise the last loaded
// map is printed.. but OTOH, who cares
const char* curmap = sessLocal.mapSpawnData.serverInfo.GetString( "si_map" );
if ( curmap[0] != '\0' ) {
common->Printf( "Current Map: %s\n", curmap );
}
return;
}
map.StripFileExtension();