Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstreams #712

Merged
merged 88 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
20be829
Organize the Sandbox Panel window (#33684)
SpaceManiac Dec 7, 2024
c85642d
let bagel be played at max pop (#33769)
Emisse Dec 7, 2024
337952d
Codeowners cleanup (#33297)
VasilisThePikachu Dec 8, 2024
3d53e74
Update Credits (#33772)
github-actions[bot] Dec 8, 2024
299b13f
Give silicons proper lobby/character editor previews (#33763)
PJB3005 Dec 8, 2024
4661e9e
Automatic changelog update
PJBot Dec 8, 2024
73d5129
Amber Station - Playtest Fixes (#33773)
southbridge-fur Dec 8, 2024
8472603
Revert "Simplify separated screen top menu (#33047)"
VasilisThePikachu Dec 8, 2024
0c4dd9d
Revert "Simplify separated screen top menu (#33047)" (Stable -> Maste…
Errant-4 Dec 8, 2024
f9da258
Singularity equipment can now be activated with E interact (#33762)
PJB3005 Dec 8, 2024
98ad7a8
Automatic changelog update
PJBot Dec 8, 2024
34bfc59
Fix detective Vox spawning with their chosen outer clothing on the fl…
ArtisticRoomba Dec 8, 2024
c4556fc
Automatic changelog update
PJBot Dec 8, 2024
ede8a1d
Fix gas pipe leaking when unanchoring or breaking them (#33774)
slarticodefast Dec 8, 2024
670f1a8
Automatic changelog update
PJBot Dec 8, 2024
d57e731
Signal timer duration limit (#33781)
Errant-4 Dec 9, 2024
a7e1adf
Automatic changelog update
PJBot Dec 9, 2024
8f2b19e
Popup when being pulled shows who is pulling you (#33612)
Plykiya Dec 9, 2024
1510e89
Automatic changelog update
PJBot Dec 9, 2024
7fd8980
Fix Disposals Ejections (#33468)
sleepyyapril Dec 9, 2024
38c35d8
Major Marathon atmospherics rework (#33688)
dylanstrategie Dec 9, 2024
5ab8e46
Adds an introductory message to the user-facing ahelp chat window (#3…
deathride58 Dec 9, 2024
a7957dd
Automatic changelog update
PJBot Dec 9, 2024
8bb4c82
add "Changes: Audio" label to labeler (#33790)
slarticodefast Dec 9, 2024
3844352
Derelict icon hotfix (#33768)
ScarKy0 Dec 9, 2024
60bf48c
You can now pet the AI core. (#33788)
ScarKy0 Dec 9, 2024
35b1c04
Automatic changelog update
PJBot Dec 9, 2024
9cb46d9
Bar related tweaks (#33505)
joshepvodka Dec 9, 2024
dd96f77
Automatic changelog update
PJBot Dec 9, 2024
b1fca73
Meta station TEG power fixes + misc stuff (#33791)
ArtisticRoomba Dec 9, 2024
0e4728b
Fix: SMES now has wirepanels visuals (#33808)
ArtisticRoomba Dec 10, 2024
ee10fc2
Automatic changelog update
PJBot Dec 10, 2024
7ed32f2
Merge into master: Derelict icon hotfix (#33768) (#33802)
slarticodefast Dec 10, 2024
2b487ba
Fix blank newline on empty examine groups (#33813)
metalgearsloth Dec 10, 2024
7b681b6
Automatic changelog update
PJBot Dec 10, 2024
b4ee01e
Translate Upstream #2748 (#2837)
lzk228 Dec 10, 2024
9affb3c
Перевод Upstream #2830 (#2836)
lapatison Dec 10, 2024
588e4d7
translate borer names (#2835)
lzk228 Dec 10, 2024
42a8309
[Localize] Poster 52 (#2840)
MureixloI Dec 11, 2024
04b738a
Translate new diona names (#2839)
lzk228 Dec 11, 2024
89522e7
Made anchor visuals generic (#33810)
TGRCdev Dec 11, 2024
c28f4fd
Fix greytide virus hitting other maps (#33806)
slarticodefast Dec 11, 2024
fc738b6
Automatic changelog update
PJBot Dec 11, 2024
976cae9
Names camera routers (#33496)
IamVelcroboy Dec 11, 2024
1a8e469
Fix battery self-recharge mispredicts (#33384)
metalgearsloth Dec 11, 2024
5ba868a
Automatic changelog update
PJBot Dec 11, 2024
ce9fc82
Rework the HoS's Energy Shotgun (Varying energy consumption depending…
BramvanZijp Dec 11, 2024
67d444f
Automatic changelog update
PJBot Dec 11, 2024
9d99701
[Resprite] Medical uniforms & rollerbeds (#2802)
MureixloI Dec 11, 2024
ae180fc
Automatic changelog update
IanComradeBot Dec 11, 2024
842bbeb
Warden headdresses In-hand Sprites (#33521)
onesch Dec 12, 2024
d99479e
Revert "new year lobbyscreens removed" (#2831)
NotSoDana Dec 12, 2024
4efc031
Surgeon spawnpoint (#2841)
Ko4ergaPunk Dec 12, 2024
95ecf19
fix nukedisk chances (#2745)
TokenStyle Dec 12, 2024
48f62da
Update APE guidebook to contain Sigma particles, Transformation and c…
Winkarst-cpu Dec 12, 2024
b959a64
Automatic changelog update
PJBot Dec 12, 2024
18322ec
fix ghost command error string (#33838)
lzk228 Dec 12, 2024
d89e6aa
Adds surgeon spawnpoint on maps (#2845)
Ko4ergaPunk Dec 12, 2024
9d7846e
Safari hat In-hand Sprites (#33464)
onesch Dec 12, 2024
115b3e0
Increase war ops evac time (#33628)
lzk228 Dec 13, 2024
9329fcf
Automatic changelog update
PJBot Dec 13, 2024
b46f487
Add meat tag to Five Alarm Burger (#33848)
LevitatingTree Dec 13, 2024
e704f4e
Automatic changelog update
PJBot Dec 13, 2024
7eb714d
Monospace Support for Rich Text (#33830)
southbridge-fur Dec 13, 2024
2c00abb
Automatic changelog update
PJBot Dec 13, 2024
06071a5
Secret stash wrench anchoring fix (#31779)
godisdeadLOL Dec 13, 2024
744b105
Automatic changelog update
PJBot Dec 13, 2024
9c8207e
Winter stuff tweak (#2833)
Ko4ergaPunk Dec 14, 2024
7d82d2d
Amber station updates (#33845)
southbridge-fur Dec 14, 2024
df7b9d1
Other colour of the binary channel (#33841)
Nimfar11 Dec 14, 2024
102d4fb
Automatic changelog update
PJBot Dec 14, 2024
7b908e9
[MAPS] Silly Christmass Date (#2854)
Doctorjakes Dec 14, 2024
d46a511
[MAPS] Paper Christmass Date (#2853)
XsenonDash Dec 14, 2024
eac62b1
[MAPS] Avrite New Year update (#2852)
CaptainMaru Dec 14, 2024
d27e5d9
[Maps] Tushkan new year update (#2851)
Ko4ergaPunk Dec 14, 2024
b33fc55
[Maps] Pilgrim new year update (#2850)
Ko4ergaPunk Dec 14, 2024
b75a24a
[Maps] Maus new year update (#2849)
Ko4ergaPunk Dec 14, 2024
1be6a6b
[Maps] Awesome new year update (#2848)
Stubaretka24 Dec 14, 2024
2f27031
[Maps] Outpost return (#2847)
kvant8 Dec 14, 2024
74f47dc
[Maps] Astra new year update (#2844)
lastPechkin Dec 14, 2024
7fa704a
Update corvax_delta.yml (#2856)
Bloodcanis Dec 14, 2024
e78a01c
Merge remote-tracking branch 'wizard/master' into upstream-sync
Roudenn Dec 15, 2024
3d1fba9
Merge remote-tracking branch 'corvax/master' into upstream-sync
Roudenn Dec 15, 2024
b96e693
Merge pull request #982 from Roudenn/upstream-sync
Rxup Dec 16, 2024
780b51c
Automatic changelog update
Dec 16, 2024
df17876
Yooooo! (#983)
RedBurningPhoenix Dec 17, 2024
03cf326
Automatic changelog update
Dec 17, 2024
03e3ee3
Merge branch 'master' into upstreams
CrimeMoot Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
- changed-files:
- any-glob-to-any-file: '**/*.ftl'

"Changes: No C#":
"Changes: Audio":
- changed-files:
- any-glob-to-any-file: '**/*.ogg'

"No C#":
- changed-files:
# Equiv to any-glob-to-all as long as this has one matcher. If ALL changed files are not C# files, then apply label.
- all-globs-to-all-files: "!**/*.cs"
19 changes: 17 additions & 2 deletions Content.Client/Lobby/LobbyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,21 @@ public EntityUid LoadProfileEntity(HumanoidCharacterProfile? humanoid, JobProtot
{
EntityUid dummyEnt;

if (humanoid is not null)
EntProtoId? previewEntity = null;
if (humanoid != null && jobClothes)
{
job ??= GetPreferredJob(humanoid);

previewEntity = job.JobPreviewEntity ?? (EntProtoId?)job?.JobEntity;
}

if (previewEntity != null)
{
// Special type like borg or AI, do not spawn a human just spawn the entity.
dummyEnt = EntityManager.SpawnEntity(previewEntity, MapCoordinates.Nullspace);
return dummyEnt;
}
else if (humanoid is not null)
{
var dummy = _prototypeManager.Index<SpeciesPrototype>(humanoid.Species).DollPrototype;
dummyEnt = EntityManager.SpawnEntity(dummy, MapCoordinates.Nullspace);
Expand All @@ -471,7 +485,8 @@ public EntityUid LoadProfileEntity(HumanoidCharacterProfile? humanoid, JobProtot

if (humanoid != null && jobClothes)
{
job ??= GetPreferredJob(humanoid);
DebugTools.Assert(job != null);

GiveDummyJobClothes(dummyEnt, humanoid, job);

if (_prototypeManager.HasIndex<RoleLoadoutPrototype>(LoadoutSystem.GetJobPrototype(job.ID)))
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Lobby/UI/CharacterPickerButton.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
SeparationOverride="0"
Name="InternalHBox">
<SpriteView Scale="2 2"
Margin="0 4 4 4"
OverrideDirection="South"
Name="View"/>
<Label Name="DescriptionLabel"
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Lobby/UI/HumanoidProfileEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
</BoxContainer>
<!-- Right side -->
<BoxContainer Orientation="Vertical" VerticalExpand="True" VerticalAlignment="Center">
<SpriteView Name="SpriteView" Scale="8 8" SizeFlagsStretchRatio="1" />
<SpriteView Name="SpriteView" Scale="8 8" Margin="4" SizeFlagsStretchRatio="1" />
<BoxContainer Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 5">
<Button Name="SpriteRotateLeft" Text="◀" StyleClasses="OpenRight" />
<cc:VSeparator Margin="2 0 3 0" />
Expand Down
4 changes: 3 additions & 1 deletion Content.Client/Paper/UI/PaperWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;
using Robust.Client.UserInterface.RichText;
using Content.Client.UserInterface.RichText;
using Robust.Shared.Input;

namespace Content.Client.Paper.UI
Expand Down Expand Up @@ -43,7 +44,8 @@ public sealed partial class PaperWindow : BaseWindow
typeof(BulletTag),
typeof(ColorTag),
typeof(HeadingTag),
typeof(ItalicTag)
typeof(ItalicTag),
typeof(MonoTag)
};

public event Action<string>? OnSaved;
Expand Down
7 changes: 1 addition & 6 deletions Content.Client/Sandbox/SandboxSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public bool Copy(ICommonSession? session, EntityCoordinates coords, EntityUid ui
}

// Try copy tile.

if (!_map.TryFindGridAt(_transform.ToMapCoordinates(coords), out var gridUid, out var grid) || !_mapSystem.TryGetTileRef(gridUid, grid, coords, out var tileRef))
return false;

Expand Down Expand Up @@ -157,10 +157,5 @@ public void ShowBb()
{
_consoleHost.ExecuteCommand("physics shapes");
}

public void MachineLinking()
{
_consoleHost.ExecuteCommand("signallink");
}
}
}
34 changes: 34 additions & 0 deletions Content.Client/UserInterface/RichText/MonoTag.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System.Linq;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface.RichText;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;

namespace Content.Client.UserInterface.RichText;

/// <summary>
/// Sets the font to a monospaced variant
/// </summary>
public sealed class MonoTag : IMarkupTag
{
[ValidatePrototypeId<FontPrototype>] public const string MonoFont = "Monospace";

[Dependency] private readonly IResourceCache _resourceCache = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

public string Name => "mono";

/// <inheritdoc/>
public void PushDrawContext(MarkupNode node, MarkupDrawingContext context)
{
var font = FontTag.CreateFont(context.Font, node, _resourceCache, _prototypeManager, MonoFont);
context.Font.Push(font);
}

/// <inheritdoc/>
public void PopDrawContext(MarkupNode node, MarkupDrawingContext context)
{
context.Font.Pop();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,10 @@ private void EnsureInit(bool relayActive)
_window.OnClose += () => { OnClose?.Invoke(); };
_window.OnOpen += () => { OnOpen?.Invoke(); };
_window.Contents.AddChild(_chatPanel);

var introText = Loc.GetString("bwoink-system-introductory-message");
var introMessage = new SharedBwoinkSystem.BwoinkTextMessage( _ownerId, SharedBwoinkSystem.SystemUserId, introText);
Receive(introMessage);
}

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Client.Administration.Managers;
using System.Numerics;
using Content.Client.Administration.Managers;
using Content.Client.Gameplay;
using Content.Client.Markers;
using Content.Client.Sandbox;
Expand All @@ -7,9 +8,7 @@
using Content.Client.UserInterface.Systems.DecalPlacer;
using Content.Client.UserInterface.Systems.Sandbox.Windows;
using Content.Shared.Input;
using Content.Shared.Silicons.StationAi;
using JetBrains.Annotations;
using Robust.Client.Console;
using Robust.Client.Debugging;
using Robust.Client.Graphics;
using Robust.Client.Input;
Expand Down Expand Up @@ -109,9 +108,13 @@ public void LoadButton()

private void EnsureWindow()
{
if(_window is { Disposed: false })
if (_window is { Disposed: false })
return;
_window = UIManager.CreateWindow<SandboxWindow>();
// Pre-center the window without forcing it to the center every time.
_window.OpenCentered();
_window.Close();

_window.OnOpen += () => { SandboxButton!.Pressed = true; };
_window.OnClose += () => { SandboxButton!.Pressed = false; };
_window.ToggleLightButton.Pressed = !_light.Enabled;
Expand Down Expand Up @@ -149,7 +152,6 @@ private void EnsureWindow()
_window.ToggleSubfloorButton.OnPressed += _ => _sandbox.ToggleSubFloor();
_window.ShowMarkersButton.OnPressed += _ => _sandbox.ShowMarkers();
_window.ShowBbButton.OnPressed += _ => _sandbox.ShowBb();
_window.MachineLinkingButton.OnPressed += _ => _sandbox.MachineLinking();
}

private void CheckSandboxVisibility()
Expand All @@ -164,7 +166,7 @@ public void OnStateExited(GameplayState state)
{
if (_window != null)
{
_window.Dispose();
_window.Close();
_window = null;
}

Expand Down Expand Up @@ -209,7 +211,7 @@ private void ToggleWindow()
if (_sandbox.SandboxAllowed && _window.IsOpen != true)
{
UIManager.ClickSound();
_window.OpenCentered();
_window.Open();
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@
Title="{Loc sandbox-window-title}"
Resizable="False">
<BoxContainer Orientation="Vertical" SeparationOverride="4">
<Button Name="AiOverlayButton" Access="Public" Text="{Loc sandbox-window-ai-overlay-button}" ToggleMode="True"/>
<Button Name="RespawnButton" Access="Public" Text="{Loc sandbox-window-respawn-button}"/>
<Button Name="SpawnEntitiesButton" Access="Public" Text="{Loc sandbox-window-spawn-entities-button}"/>
<Label Text="{Loc sandbox-window-map-editing-label}"/>
<Button Name="SpawnTilesButton" Access="Public" Text="{Loc sandbox-window-spawn-tiles-button}"/>
<Button Name="SpawnEntitiesButton" Access="Public" Text="{Loc sandbox-window-spawn-entities-button}"/>
<Button Name="SpawnDecalsButton" Access="Public" Text="{Loc sandbox-window-spawn-decals-button}"/>
<Button Name="GiveFullAccessButton" Access="Public" Text="{Loc sandbox-window-grant-full-access-button}"/>
<Button Name="GiveAghostButton" Access="Public" Text="{Loc sandbox-window-ghost-button}"/>

<Label Text="{Loc sandbox-window-visibility-label}"/>
<Button Name="ToggleLightButton" Access="Public" Text="{Loc sandbox-window-toggle-lights-button}" ToggleMode="True"/>
<Button Name="ToggleFovButton" Access="Public" Text="{Loc sandbox-window-toggle-fov-button}" ToggleMode="True"/>
<Button Name="ToggleShadowsButton" Access="Public" Text="{Loc sandbox-window-toggle-shadows-button}" ToggleMode="True"/>
<Button Name="ToggleSubfloorButton" Access="Public" Text="{Loc sandbox-window-toggle-subfloor-button}" ToggleMode="True"/>
<Button Name="SuicideButton" Access="Public" Text="{Loc sandbox-window-toggle-suicide-button}" ToggleMode="True"/>
<Button Name="AiOverlayButton" Access="Public" Text="{Loc sandbox-window-ai-overlay-button}" ToggleMode="True"/>
<Button Name="ShowMarkersButton" Access="Public" Text="{Loc sandbox-window-show-spawns-button}" ToggleMode="True"/>
<Button Name="ShowBbButton" Access="Public" Text="{Loc sandbox-window-show-bb-button}" ToggleMode="True"/>
<Button Name="MachineLinkingButton" Access="Public" Text="{Loc sandbox-window-link-machines-button}" ToggleMode="True"/>

<Label Text="{Loc sandbox-window-your-character-label}"/>
<Button Name="GiveAghostButton" Access="Public" Text="{Loc sandbox-window-ghost-button}"/>
<Button Name="GiveFullAccessButton" Access="Public" Text="{Loc sandbox-window-grant-full-access-button}"/>
<Button Name="SuicideButton" Access="Public" Text="{Loc sandbox-window-toggle-suicide-button}"/>
<Button Name="RespawnButton" Access="Public" Text="{Loc sandbox-window-respawn-button}"/>
</BoxContainer>
</windows:SandboxWindow>
6 changes: 6 additions & 0 deletions Content.Client/Weapons/Ranged/Systems/GunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public override void Initialize()
base.Initialize();
UpdatesOutsidePrediction = true;
SubscribeLocalEvent<AmmoCounterComponent, ItemStatusCollectMessage>(OnAmmoCounterCollect);
SubscribeLocalEvent<AmmoCounterComponent, UpdateClientAmmoEvent>(OnUpdateClientAmmo);
SubscribeAllEvent<MuzzleFlashEvent>(OnMuzzleFlash);

// Plays animated effects on the client.
Expand All @@ -88,6 +89,11 @@ public override void Initialize()

}

private void OnUpdateClientAmmo(EntityUid uid, AmmoCounterComponent ammoComp, ref UpdateClientAmmoEvent args)
{
UpdateAmmoCount(uid, ammoComp);
}

private void OnMuzzleFlash(MuzzleFlashEvent args)
{
var gunUid = GetEntity(args.Uid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ private void AddTricksVerbs(GetVerbsEvent<Verb> args)
var recharger = EnsureComp<BatterySelfRechargerComponent>(args.Target);
recharger.AutoRecharge = true;
recharger.AutoRechargeRate = battery.MaxCharge; // Instant refill.
recharger.AutoRechargePause = false; // No delay.
},
Impact = LogImpact.Medium,
Message = Loc.GetString("admin-trick-infinite-battery-object-description"),
Expand Down Expand Up @@ -607,6 +608,7 @@ private void AddTricksVerbs(GetVerbsEvent<Verb> args)

recharger.AutoRecharge = true;
recharger.AutoRechargeRate = battery.MaxCharge; // Instant refill.
recharger.AutoRechargePause = false; // No delay.
}
},
Impact = LogImpact.Extreme,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.Piping.Components;
using Content.Server.NodeContainer;
using Content.Server.NodeContainer.EntitySystems;
using Content.Server.NodeContainer.Nodes;
using Content.Server.Popups;
using Content.Shared.Atmos;
using Content.Shared.Construction.Components;
using Content.Shared.Destructible;
using Content.Shared.Popups;
using JetBrains.Annotations;
using Robust.Shared.Player;

namespace Content.Server.Atmos.Piping.EntitySystems
{
[UsedImplicitly]
public sealed class AtmosUnsafeUnanchorSystem : EntitySystem
{
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
[Dependency] private readonly NodeGroupSystem _group = default!;
[Dependency] private readonly PopupSystem _popup = default!;

public override void Initialize()
{
SubscribeLocalEvent<AtmosUnsafeUnanchorComponent, BeforeUnanchoredEvent>(OnBeforeUnanchored);
SubscribeLocalEvent<AtmosUnsafeUnanchorComponent, UserUnanchoredEvent>(OnUserUnanchored);
SubscribeLocalEvent<AtmosUnsafeUnanchorComponent, UnanchorAttemptEvent>(OnUnanchorAttempt);
SubscribeLocalEvent<AtmosUnsafeUnanchorComponent, BreakageEventArgs>(OnBreak);
}
Expand Down Expand Up @@ -48,56 +49,54 @@ private void OnUnanchorAttempt(EntityUid uid, AtmosUnsafeUnanchorComponent compo
}
}

private void OnBeforeUnanchored(EntityUid uid, AtmosUnsafeUnanchorComponent component, BeforeUnanchoredEvent args)
// When unanchoring a pipe, leak the gas that was inside the pipe element.
// At this point the pipe has been scheduled to be removed from the group, but that won't happen until the next Update() call in NodeGroupSystem,
// so we have to force an update.
// This way the gas inside other connected pipes stays unchanged, while the removed pipe is completely emptied.
private void OnUserUnanchored(EntityUid uid, AtmosUnsafeUnanchorComponent component, UserUnanchoredEvent args)
{
if (component.Enabled)
{
_group.ForceUpdate();
LeakGas(uid);
}
}

private void OnBreak(EntityUid uid, AtmosUnsafeUnanchorComponent component, BreakageEventArgs args)
{
LeakGas(uid);
LeakGas(uid, false);
// Can't use DoActsBehavior["Destruction"] in the same trigger because that would prevent us
// from leaking. So we make up for this by queueing deletion here.
QueueDel(uid);
}

/// <summary>
/// Leak gas from the uid's NodeContainer into the tile atmosphere.
/// Setting removeFromPipe to false will duplicate the gas inside the pipe intead of moving it.
/// This is needed to properly handle the gas in the pipe getting deleted with the pipe.
/// </summary>
public void LeakGas(EntityUid uid)
public void LeakGas(EntityUid uid, bool removeFromPipe = true)
{
if (!EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodes))
return;

if (_atmosphere.GetContainingMixture(uid, true, true) is not {} environment)
if (_atmosphere.GetContainingMixture(uid, true, true) is not { } environment)
environment = GasMixture.SpaceGas;

var lost = 0f;
var timesLost = 0;

foreach (var node in nodes.Nodes.Values)
{
if (node is not PipeNode pipe)
continue;

var difference = pipe.Air.Pressure - environment.Pressure;
lost += Math.Min(
pipe.Volume / pipe.Air.Volume * pipe.Air.TotalMoles,
difference * environment.Volume / (environment.Temperature * Atmospherics.R)
);
timesLost++;
}

var sharedLoss = lost / timesLost;
var buffer = new GasMixture();

foreach (var node in nodes.Nodes.Values)
{
if (node is not PipeNode pipe)
continue;

_atmosphere.Merge(buffer, pipe.Air.Remove(sharedLoss));
if (removeFromPipe)
_atmosphere.Merge(buffer, pipe.Air.RemoveVolume(pipe.Volume));
else
{
var copy = new GasMixture(pipe.Air); //clone, then remove to keep the original untouched
_atmosphere.Merge(buffer, copy.RemoveVolume(pipe.Volume));
}
}

_atmosphere.Merge(environment, buffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ private void OnAnchorChanged(EntityUid uid, GasPortableComponent portable, ref A
return;

portableNode.ConnectionsEnabled = args.Anchored;

if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
{
_appearance.SetData(uid, GasPortableVisuals.ConnectedState, args.Anchored, appearance);
}
}

public bool FindGasPortIn(EntityUid? gridId, EntityCoordinates coordinates, [NotNullWhen(true)] out GasPortComponent? port)
Expand Down
Loading
Loading