Skip to content

Commit

Permalink
fix(src, map): Исправлен спавн ГостБара, карта calm_ghostly_bar.yml т…
Browse files Browse the repository at this point in the history
…еперь является именно картой а не гридом.
  • Loading branch information
Schrodinger71 committed Feb 20, 2025
1 parent 47bb999 commit 45e540b
Show file tree
Hide file tree
Showing 3 changed files with 471 additions and 714 deletions.
18 changes: 12 additions & 6 deletions Content.Server/ADT/Ghostbar/Systems/GhostBarSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using Content.Server.Stealth;
using Robust.Shared.EntitySerialization.Systems;
using Robust.Shared.EntitySerialization;
using System.Numerics;
using Robust.Shared.Map.Components;
using System.Linq;
using Robust.Shared.Utility;

Expand All @@ -44,10 +44,12 @@ public override void Initialize()

SubscribeNetworkEvent<GhostBarSpawnEvent>(SpawnPlayer);
}

private void OnRoundStart(RoundStartingEvent ev)
{
_mapSystem.CreateMap(out var mapId);
var opts = new DeserializationOptions {
// _mapSystem.CreateMap(out var mapId);
var opts = new DeserializationOptions
{
StoreYamlUids = true,
InitializeMaps = true,
};
Expand All @@ -57,12 +59,16 @@ private void OnRoundStart(RoundStartingEvent ev)
if (GhostBarMap == null)
return;

if (!_mapLoader.TryLoadMapWithId(mapId, new ResPath(GhostBarMap.Path), out _, out _, opts))
if (!_mapLoader.TryLoadMap(new ResPath(GhostBarMap.Path), out var mapId, out _, opts))
return;

_mapSystem.SetPaused(mapId, false);
if (!TryComp<MapComponent>(mapId, out var mapComponent))
return;

_mapSystem.SetPaused(mapComponent.MapId, false);

if (GhostBarMap.Weather.HasValue)
_weathersystem.SetWeather(mapId, _prototypeManager.Index(GhostBarMap.Weather.Value), null);
_weathersystem.SetWeather(mapComponent.MapId, _prototypeManager.Index(GhostBarMap.Weather.Value), null);
}

private void OnPlayerGhosted(EntityUid uid, GhostBarPlayerComponent component, MindRemovedMessage args)
Expand Down
35 changes: 29 additions & 6 deletions Resources/Maps/ADTMaps/Ghostbars/calm_ghostly_bar.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
meta:
format: 6
postmapinit: false
format: 7
category: Map
engineVersion: 247.0.0
forkId: ""
forkVersion: ""
time: 02/20/2025 13:35:06
entityCount: 1740
maps:
- 1740
grids:
- 1
orphans: []
nullspace: []
tilemap:
0: Space
1: ADTFloorBlackOrange
Expand Down Expand Up @@ -49,7 +60,7 @@ entities:
name: grid
- type: Transform
pos: -1.8297873,0.7446809
parent: invalid
parent: 1740
- type: MapGrid
chunks:
0,0:
Expand Down Expand Up @@ -1123,6 +1134,18 @@ entities:
- type: GasTileOverlay
- type: RadiationGridResistance
- type: NavMap
- uid: 1740
components:
- type: MetaData
name: Map Entity
- type: Transform
- type: Map
mapPaused: True
- type: PhysicsMap
- type: GridTree
- type: MovedGrids
- type: Broadphase
- type: OccluderTree
- proto: AcousticGuitarInstrument
entities:
- uid: 2
Expand Down Expand Up @@ -1463,7 +1486,7 @@ entities:
pos: 10.5,-23.5
parent: 1
- type: Door
secondsUntilStateChange: -21729.615
secondsUntilStateChange: -21767.361
state: Opening
- type: DeviceLinkSource
lastSignals:
Expand Down Expand Up @@ -1573,7 +1596,7 @@ entities:
pos: 8.5,4.5
parent: 1
- type: Door
secondsUntilStateChange: -17241.354
secondsUntilStateChange: -17279.1
state: Opening
- type: DeviceLinkSource
lastSignals:
Expand Down Expand Up @@ -11643,7 +11666,7 @@ entities:
pos: 2.5,2.5
parent: 1
- type: Door
secondsUntilStateChange: -26030.078
secondsUntilStateChange: -26067.824
state: Opening
- proto: WoodenBench
entities:
Expand Down
Loading

0 comments on commit 45e540b

Please sign in to comment.