Skip to content

Commit

Permalink
map command without any arguments prints current map name
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielGibson committed Jul 25, 2024
1 parent 794d40a commit 10eee1e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions neo/framework/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 10eee1e

Please sign in to comment.