From 6c21fcf4dcac6126d3abf1e75a6323f64a5b403f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schr=C3=B6dinger?= <132720404+Schrodinger71@users.noreply.github.com> Date: Fri, 21 Feb 2025 21:25:44 +0300 Subject: [PATCH] =?UTF-8?q?fix(src):=20=D0=9F=D0=BE=20=D0=B8=D0=B4=D0=B5?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=BE=D1=87=D0=B8=D0=BD=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=B0=20=D0=BB=D0=B0?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=D0=B5=D0=BD=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/ADT/Planet/PlanetSystem.cs | 56 +++++++++---------- .../Systems/StationPlanetSpawnerSystem.cs | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Content.Server/ADT/Planet/PlanetSystem.cs b/Content.Server/ADT/Planet/PlanetSystem.cs index 7182a225585..f0d42c7c635 100644 --- a/Content.Server/ADT/Planet/PlanetSystem.cs +++ b/Content.Server/ADT/Planet/PlanetSystem.cs @@ -58,36 +58,36 @@ public EntityUid SpawnPlanet(ProtoId id, bool runMapInit = true /// Spawns an initialized planet map from a planet prototype and loads a grid onto it. /// Returns the map entity if loading succeeded. /// - // public EntityUid? LoadPlanet(ProtoId id, string path) - // { - // var map = SpawnPlanet(id, runMapInit: false); - // var mapId = Comp(map).MapId; + public EntityUid? LoadPlanet(ProtoId id, string path) + { + var map = SpawnPlanet(id, runMapInit: false); + var mapId = Comp(map).MapId; - // if (!_mapManager.IsMapInitialized(mapId)) - // { - // Log.Error($"Map with ID {mapId} does not exist. Cannot proceed with loading."); - // return null; - // } + if (!_mapManager.IsMapInitialized(mapId)) + { + Log.Error($"Map with ID {mapId} does not exist. Cannot proceed with loading."); + return null; + } - // if (!_mapLoader.TryLoadGrid(mapId, new ResPath(path), out var grids)) - // { - // Log.Error($"Failed to load planet grid {path} for planet {id}!"); - // return null; - // } + if (!_mapLoader.TryLoadGrid(mapId, new ResPath(path), out var grids)) + { + Log.Error($"Failed to load planet grid {path} for planet {id}!"); + return null; + } - // if (grids.HasValue) - // { - // var gridUid = grids.Value; - // _setTiles.Clear(); - // var aabb = Comp(gridUid).LocalAABB; - // _biome.ReserveTiles(map, aabb.Enlarged(0.2f), _setTiles); - // } - // else - // { - // Log.Error("Grid not found for this map."); - // } + if (grids.HasValue) + { + var gridUid = grids.Value; + _setTiles.Clear(); + var aabb = Comp(gridUid).LocalAABB; + _biome.ReserveTiles(map, aabb.Enlarged(0.2f), _setTiles); + } + else + { + Log.Error("Grid not found for this map."); + } - // _map.InitializeMap(map); - // return map; - // } + _map.InitializeMap(map); + return map; + } } diff --git a/Content.Server/ADT/Station/Systems/StationPlanetSpawnerSystem.cs b/Content.Server/ADT/Station/Systems/StationPlanetSpawnerSystem.cs index 47bec16f610..7e34e567e03 100644 --- a/Content.Server/ADT/Station/Systems/StationPlanetSpawnerSystem.cs +++ b/Content.Server/ADT/Station/Systems/StationPlanetSpawnerSystem.cs @@ -20,7 +20,7 @@ private void OnMapInit(Entity ent, ref MapInitEve if (ent.Comp.GridPath is not {} path) return; - // ent.Comp.Map = _planet.LoadPlanet(ent.Comp.Planet, path.ToString()); # Закоменчено в апстриме + ent.Comp.Map = _planet.LoadPlanet(ent.Comp.Planet, path.ToString()); } private void OnShutdown(Entity ent, ref ComponentShutdown args)