public void MapLoadBegin() { var mapName = CachedMapName; var worldModel = _engine.Models.LoadModel(mapName); //This should never happen since the map file is compared by CRC before being loaded //TODO: use proper exception type that engine can catch if (!(worldModel is BSPModel bspWorldModel)) { throw new InvalidOperationException($"Model {mapName} is not a map"); } MapInfo = new MapInfo(NetUtilities.ConvertToPlatformPath(mapName), MapInfo?.Name, bspWorldModel); _clientUI.MapLoadBegin(); _renderer.LoadModels(MapInfo.Model, _engine.ModelManager); _entities.MapLoadBegin(); }