diff --git a/Content.IntegrationTests/Tests/EntityTest.cs b/Content.IntegrationTests/Tests/EntityTest.cs index 44cf1be93e..019a292772 100644 --- a/Content.IntegrationTests/Tests/EntityTest.cs +++ b/Content.IntegrationTests/Tests/EntityTest.cs @@ -39,7 +39,7 @@ namespace Content.IntegrationTests.Tests .Where(p => !p.Abstract) .Where(p => !pair.IsTestPrototype(p)) .Where(p => !p.Components.ContainsKey("MapGrid")) // This will smash stuff otherwise. - .Where(p => !p.Components.ContainsKey("RoomFill")) // CP14 Boilerplate - TODO: Remove it after wizden fix + .Where(p => !p.Components.ContainsKey("RoomFill")) .Select(p => p.ID) .ToList(); @@ -102,7 +102,7 @@ namespace Content.IntegrationTests.Tests .Where(p => !p.Abstract) .Where(p => !pair.IsTestPrototype(p)) .Where(p => !p.Components.ContainsKey("MapGrid")) // This will smash stuff otherwise. - .Where(p => !p.Components.ContainsKey("RoomFill")) // CP14 Boilerplate - TODO: Remove it after wizden fix + .Where(p => !p.Components.ContainsKey("RoomFill")) .Select(p => p.ID) .ToList(); foreach (var protoId in protoIds) @@ -163,7 +163,6 @@ namespace Content.IntegrationTests.Tests .Where(p => !p.Abstract) .Where(p => !pair.IsTestPrototype(p)) .Where(p => !p.Components.ContainsKey("MapGrid")) // This will smash stuff otherwise. - .Where(p => !p.Components.ContainsKey("RoomFill")) // CP14 Boilerplate - TODO: Remove it after wizden fix .Select(p => p.ID) .ToList(); @@ -238,7 +237,6 @@ namespace Content.IntegrationTests.Tests var excluded = new[] { "MapGrid", - "RoomFill", // CP14 Boilerplate - TODO: Remove it after wizden fix "StationEvent", "TimedDespawn", @@ -345,7 +343,7 @@ namespace Content.IntegrationTests.Tests "DebugExceptionInitialize", "DebugExceptionStartup", "GridFill", - "RoomFill", // CP14 Boilerplate - TODO: Remove it after wizden fix + "RoomFill", "Map", // We aren't testing a map entity in this test "MapGrid", "Broadphase", diff --git a/Content.Server/Procedural/DungeonSystem.Rooms.cs b/Content.Server/Procedural/DungeonSystem.Rooms.cs index c9e3f72136..f83cce66fd 100644 --- a/Content.Server/Procedural/DungeonSystem.Rooms.cs +++ b/Content.Server/Procedural/DungeonSystem.Rooms.cs @@ -130,31 +130,31 @@ public sealed partial class DungeonSystem var finalRoomRotation = roomTransform.Rotation(); - if (clearExisting) - { - var point1 = Vector2.Transform(-room.Size / 2, roomTransform); - var point2 = Vector2.Transform(room.Size / 2, roomTransform); - - var gridBounds = GetRotatedBox(point1, point2, finalRoomRotation); - - entitySet.Clear(); - // Polygon skin moment - gridBounds = gridBounds.Enlarged(-0.05f); - _lookup.GetLocalEntitiesIntersecting(gridUid, gridBounds, entitySet, LookupFlags.Uncontained); - - foreach (var templateEnt in entitySet) - { - Del(templateEnt); - } - - if (TryComp(gridUid, out DecalGridComponent? decalGrid)) - { - foreach (var decal in _decals.GetDecalsIntersecting(gridUid, gridBounds, decalGrid)) - { - _decals.RemoveDecal(gridUid, decal.Index, decalGrid); - } - } - } + //if (clearExisting) //CP14 disable default clearExisting + //{ + // var point1 = Vector2.Transform(-room.Size / 2, roomTransform); + // var point2 = Vector2.Transform(room.Size / 2, roomTransform); +// + // var gridBounds = GetRotatedBox(point1, point2, finalRoomRotation); +// + // entitySet.Clear(); + // // Polygon skin moment + // gridBounds = gridBounds.Enlarged(-0.05f); + // _lookup.GetLocalEntitiesIntersecting(gridUid, gridBounds, entitySet, LookupFlags.Uncontained); +// + // foreach (var templateEnt in entitySet) + // { + // Del(templateEnt); + // } +// + // if (TryComp(gridUid, out DecalGridComponent? decalGrid)) + // { + // foreach (var decal in _decals.GetDecalsIntersecting(gridUid, gridBounds, decalGrid)) + // { + // _decals.RemoveDecal(gridUid, decal.Index, decalGrid); + // } + // } + //} var roomCenter = (room.Offset + room.Size / 2f) * grid.TileSize; var tileOffset = -roomCenter + grid.TileSizeHalfVector; @@ -183,14 +183,14 @@ public sealed partial class DungeonSystem _tiles.Add((rounded, tileRef.Tile)); //CP14 clearExisting variant - //if (clearExisting) - //{ - // var anchored = _maps.GetAnchoredEntities((gridUid, grid), rounded); - // foreach (var ent in anchored) - // { - // QueueDel(ent); - // } - //} + if (clearExisting) + { + var anchored = _maps.GetAnchoredEntities((gridUid, grid), rounded); + foreach (var ent in anchored) + { + QueueDel(ent); + } + } //CP14 clearExisting variant end } } diff --git a/Content.Server/_CP14/Demiplane/CP14DemiplanSystem.Connections.cs b/Content.Server/_CP14/Demiplane/CP14DemiplanSystem.Connections.cs index 418a168517..aee960b47d 100644 --- a/Content.Server/_CP14/Demiplane/CP14DemiplanSystem.Connections.cs +++ b/Content.Server/_CP14/Demiplane/CP14DemiplanSystem.Connections.cs @@ -14,20 +14,20 @@ public sealed partial class CP14DemiplaneSystem private void OnRiftInit(Entity rift, ref MapInitEvent args) { var map = Transform(rift).MapUid; - if (TryComp(map, out var demiplan)) // In demiplan + if (TryComp(map, out var demiplane)) // In demiplane { if (rift.Comp.TryAutoLinkToMap) rift.Comp.Demiplane = map.Value; if (rift.Comp.ActiveTeleport) - AddDemiplanRandomEntryPoint((map.Value, demiplan), rift); + AddDemiplaneRandomEntryPoint((map.Value, demiplane), rift); } - else if (rift.Comp.Demiplane is not null) //We out of demiplan + else if (rift.Comp.Demiplane is not null) //We out of demiplane { if (TryComp(rift.Comp.Demiplane, out var riftDemiplane)) { if (rift.Comp.ActiveTeleport) - AddDemiplanRandomExitPoint((rift.Comp.Demiplane.Value, riftDemiplane), rift); + AddDemiplaneRandomExitPoint((rift.Comp.Demiplane.Value, riftDemiplane), rift); } } } @@ -40,35 +40,32 @@ public sealed partial class CP14DemiplaneSystem if (!TryComp(rift.Comp.Demiplane, out var riftDemiplane)) return; - RemoveDemiplanRandomEntryPoint((rift.Comp.Demiplane.Value, riftDemiplane), rift); + RemoveDemiplaneRandomEntryPoint((rift.Comp.Demiplane.Value, riftDemiplane), rift); RemoveDemiplanRandomExitPoint((rift.Comp.Demiplane.Value, riftDemiplane), rift); } /// - ///Add a position in the real world where you can get out of this demiplan + ///Add a position in the real world where you can get out of this demiplane /// - private void AddDemiplanRandomExitPoint(Entity demiplan, + private void AddDemiplaneRandomExitPoint(Entity demiplane, Entity exitPoint) { - if (demiplan.Comp.ExitPoints.Contains(exitPoint)) - return; - - demiplan.Comp.ExitPoints.Add(exitPoint); - exitPoint.Comp.Demiplane = demiplan; + demiplane.Comp.ExitPoints.Add(exitPoint); + exitPoint.Comp.Demiplane = demiplane; } /// - /// Removing the demiplan exit point, one of which the player can exit to + /// Removing the demiplane exit point, one of which the player can exit to /// - private void RemoveDemiplanRandomExitPoint(Entity? demiplan, + private void RemoveDemiplanRandomExitPoint(Entity? demiplane, EntityUid exitPoint) { if (!TryComp(exitPoint, out var riftComp)) return; - if (demiplan is not null && demiplan.Value.Comp.ExitPoints.Contains(exitPoint)) + if (demiplane is not null && demiplane.Value.Comp.ExitPoints.Contains(exitPoint)) { - demiplan.Value.Comp.ExitPoints.Remove(exitPoint); + demiplane.Value.Comp.ExitPoints.Remove(exitPoint); riftComp.Demiplane = null; } @@ -77,27 +74,24 @@ public sealed partial class CP14DemiplaneSystem } /// - /// Add a position within the demiplan that can be entered into the demiplan + /// Add a position within the demiplane that can be entered into the demiplane /// - private void AddDemiplanRandomEntryPoint(Entity demiplan, + private void AddDemiplaneRandomEntryPoint(Entity demiplane, Entity entryPoint) { - if (demiplan.Comp.EntryPoints.Contains(entryPoint)) - return; - - demiplan.Comp.EntryPoints.Add(entryPoint); - entryPoint.Comp.Demiplane = demiplan; + demiplane.Comp.EntryPoints.Add(entryPoint); + entryPoint.Comp.Demiplane = demiplane; } - private void RemoveDemiplanRandomEntryPoint(Entity? demiplan, + private void RemoveDemiplaneRandomEntryPoint(Entity? demiplane, EntityUid entryPoint) { if (!TryComp(entryPoint, out var riftComp)) return; - if (demiplan is not null && demiplan.Value.Comp.EntryPoints.Contains(entryPoint)) + if (demiplane is not null && demiplane.Value.Comp.EntryPoints.Contains(entryPoint)) { - demiplan.Value.Comp.EntryPoints.Remove(entryPoint); + demiplane.Value.Comp.EntryPoints.Remove(entryPoint); riftComp.Demiplane = null; } @@ -105,26 +99,26 @@ public sealed partial class CP14DemiplaneSystem QueueDel(entryPoint); } - public bool TryGetDemiplanEntryPoint(Entity demiplan, out EntityUid? entryPoint) + public bool TryGetDemiplaneEntryPoint(Entity demiplane, out EntityUid? entryPoint) { entryPoint = null; - if (demiplan.Comp.EntryPoints.Count == 0) + if (demiplane.Comp.EntryPoints.Count == 0) return false; - entryPoint = _random.Pick(demiplan.Comp.EntryPoints); + entryPoint = _random.Pick(demiplane.Comp.EntryPoints); return true; } - public bool TryGetDemiplanExitPoint(Entity demiplan, + public bool TryGetDemiplaneExitPoint(Entity demiplane, out EntityUid? exitPoint) { exitPoint = null; - if (demiplan.Comp.ExitPoints.Count == 0) + if (demiplane.Comp.ExitPoints.Count == 0) return false; - exitPoint = _random.Pick(demiplan.Comp.ExitPoints); + exitPoint = _random.Pick(demiplane.Comp.ExitPoints); return true; } } diff --git a/Content.Server/_CP14/Demiplane/CP14DemiplanSystem.Generation.cs b/Content.Server/_CP14/Demiplane/CP14DemiplanSystem.Generation.cs index 2f13363d4e..93ab253cae 100644 --- a/Content.Server/_CP14/Demiplane/CP14DemiplanSystem.Generation.cs +++ b/Content.Server/_CP14/Demiplane/CP14DemiplanSystem.Generation.cs @@ -185,8 +185,8 @@ public sealed partial class CP14DemiplaneSystem var connection = EnsureComp(tempRift); var connection2 = EnsureComp(tempRift2); - AddDemiplanRandomExitPoint(demiplane.Value, (tempRift, connection)); - AddDemiplanRandomExitPoint(demiplane.Value, (tempRift2, connection2)); + AddDemiplaneRandomExitPoint(demiplane.Value, (tempRift, connection)); + AddDemiplaneRandomExitPoint(demiplane.Value, (tempRift2, connection2)); #if !DEBUG QueueDel(generator); //wtf its crash debug build! diff --git a/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.cs b/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.cs index 7acf2b40ef..e196500033 100644 --- a/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.cs +++ b/Content.Server/_CP14/Demiplane/CP14DemiplaneSystem.cs @@ -58,7 +58,7 @@ public sealed partial class CP14DemiplaneSystem : CP14SharedDemiplaneSystem if (entity is null) return false; - if (!TryGetDemiplanEntryPoint(demiplane, out var entryPoint) || entryPoint is null) + if (!TryGetDemiplaneEntryPoint(demiplane, out var entryPoint) || entryPoint is null) { Log.Error($"{entity} cant get in demiplane {demiplane}: no active entry points!"); return false; @@ -86,7 +86,7 @@ public sealed partial class CP14DemiplaneSystem : CP14SharedDemiplaneSystem if (Transform(entity.Value).MapUid != demiplane.Owner) return false; - if (!TryGetDemiplanExitPoint(demiplane, out var connection) || connection is null) + if (!TryGetDemiplaneExitPoint(demiplane, out var connection) || connection is null) { Log.Error($"{entity} cant get out of demiplane {demiplane}: no active connections!"); return false; @@ -119,7 +119,7 @@ public sealed partial class CP14DemiplaneSystem : CP14SharedDemiplaneSystem foreach (var entry in demiplane.Comp.EntryPoints) { - RemoveDemiplanRandomEntryPoint(demiplane, entry); + RemoveDemiplaneRandomEntryPoint(demiplane, entry); } } } diff --git a/Content.Server/_CP14/DemiplaneTraveling/CP14DemiplaneTravelingSystem.cs b/Content.Server/_CP14/DemiplaneTraveling/CP14DemiplaneTravelingSystem.cs index a5e7ad0f58..0fbdc19e80 100644 --- a/Content.Server/_CP14/DemiplaneTraveling/CP14DemiplaneTravelingSystem.cs +++ b/Content.Server/_CP14/DemiplaneTraveling/CP14DemiplaneTravelingSystem.cs @@ -70,7 +70,7 @@ public sealed partial class CP14DemiplaneTravelingSystem : EntitySystem var map = Transform(uid).MapUid; if (TryComp(map, out var demiplan)) { - if (!_demiplan.TryGetDemiplanExitPoint((map.Value, demiplan), out _)) + if (!_demiplan.TryGetDemiplaneExitPoint((map.Value, demiplan), out _)) break; foreach (var ent in teleportedEnts) //We in demiplan, tp OUT @@ -87,7 +87,7 @@ public sealed partial class CP14DemiplaneTravelingSystem : EntitySystem if (rift.Demiplane is not null && TryComp(rift.Demiplane.Value, out var riftDemiplane)) { - if (!_demiplan.TryGetDemiplanEntryPoint((rift.Demiplane.Value, riftDemiplane), out _)) + if (!_demiplan.TryGetDemiplaneEntryPoint((rift.Demiplane.Value, riftDemiplane), out _)) break; foreach (var ent in teleportedEnts) //We out demiplan, tp IN