private void Cmd_Map(object sender, CommandEventArgs e)
{
string map = e.Args.Get(1);
if(map == string.Empty)
{
return;
}
map = Path.Combine(Path.GetDirectoryName(map), Path.GetFileNameWithoutExtension(map));
// make sure the level exists before trying to change, so that
// a typo at the server console won't end the game
// handle addon packs through reloadEngine
string mapPath = string.Format("maps/{0}.map", map);
if(idE.FileSystem.FileExists(mapPath) == false)
{
idConsole.WriteLine("Can't find map {0}", mapPath);
}
else
{
// TODO: FIND_ADDON
/*case FIND_ADDON:
common->Printf( "map %s is in an addon pak - reloading\n", string.c_str() );
rl_args.AppendArg( "map" );
rl_args.AppendArg( map );
cmdSystem->SetupReloadEngine( rl_args );
return;*/
}
idE.CvarSystem.SetBool("developer", false);
idE.Session.StartNewGame(map, true);
}
#endregion