Merge branch 'master' into replace-sounds-with-sound-specifier
# Conflicts: # Content.Server/Actions/Actions/DisarmAction.cs # Content.Server/Actions/Actions/ScreamAction.cs # Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs # Content.Server/Damage/Components/DamageOnHighSpeedImpactComponent.cs # Content.Server/Explosion/Components/FlashExplosiveComponent.cs # Content.Server/Physics/Controllers/MoverController.cs # Content.Server/Portal/Components/PortalComponent.cs # Content.Server/Portal/Components/TeleporterComponent.cs # Content.Server/Projectiles/Components/ProjectileComponent.cs # Content.Server/Singularity/Components/EmitterComponent.cs # Content.Server/Sound/EmitSoundSystem.cs # Content.Server/Stunnable/Components/StunbatonComponent.cs # Content.Server/Tools/Components/MultitoolComponent.cs # Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs # Content.Shared/Gravity/GravityComponent.cs # Content.Shared/Light/Component/SharedExpendableLightComponent.cs # Content.Shared/Maps/ContentTileDefinition.cs # Content.Shared/Slippery/SlipperyComponent.cs # Content.Shared/Standing/StandingStateComponent.cs # Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -10,10 +9,10 @@ using Content.Server.Construction.Components;
|
||||
using Content.Server.Disposal.Tube.Components;
|
||||
using Content.Server.DoAfter;
|
||||
using Content.Server.Hands.Components;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Acts;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Disposal.Components;
|
||||
using Content.Shared.DragDrop;
|
||||
@@ -43,7 +42,7 @@ namespace Content.Server.Disposal.Unit.Components
|
||||
[ComponentReference(typeof(SharedDisposalUnitComponent))]
|
||||
[ComponentReference(typeof(IActivate))]
|
||||
[ComponentReference(typeof(IInteractUsing))]
|
||||
public class DisposalUnitComponent : SharedDisposalUnitComponent, IInteractHand, IActivate, IInteractUsing, IThrowCollide, IGasMixtureHolder
|
||||
public class DisposalUnitComponent : SharedDisposalUnitComponent, IInteractHand, IActivate, IInteractUsing, IThrowCollide, IGasMixtureHolder, IDestroyAct
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
@@ -277,19 +276,13 @@ namespace Content.Server.Disposal.Unit.Components
|
||||
|
||||
var entryComponent = Owner.EntityManager.ComponentManager.GetComponent<DisposalEntryComponent>(entry);
|
||||
|
||||
if (Owner.Transform.Coordinates.TryGetTileAtmosphere(out var tileAtmos) &&
|
||||
tileAtmos.Air != null &&
|
||||
tileAtmos.Air.Temperature > 0)
|
||||
var atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
|
||||
|
||||
if (atmosphereSystem.GetTileMixture(Owner.Transform.Coordinates, true) is {Temperature: > 0} environment)
|
||||
{
|
||||
var tileAir = tileAtmos.Air;
|
||||
var transferMoles = 0.1f * (0.05f * Atmospherics.OneAtmosphere * 1.01f - Air.Pressure) * Air.Volume / (tileAir.Temperature * Atmospherics.R);
|
||||
var transferMoles = 0.1f * (0.05f * Atmospherics.OneAtmosphere * 1.01f - Air.Pressure) * Air.Volume / (environment.Temperature * Atmospherics.R);
|
||||
|
||||
Air = tileAir.Remove(transferMoles);
|
||||
|
||||
var atmosSystem = EntitySystem.Get<AtmosphereSystem>();
|
||||
atmosSystem
|
||||
.GetGridAtmosphere(Owner.Transform.Coordinates)?
|
||||
.Invalidate(tileAtmos.GridIndices);
|
||||
Air = environment.Remove(transferMoles);
|
||||
}
|
||||
|
||||
entryComponent.TryInsert(this);
|
||||
@@ -307,7 +300,7 @@ namespace Content.Server.Disposal.Unit.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
private void TryEjectContents()
|
||||
public void TryEjectContents()
|
||||
{
|
||||
foreach (var entity in _container.ContainedEntities.ToArray())
|
||||
{
|
||||
@@ -694,5 +687,10 @@ namespace Content.Server.Disposal.Unit.Components
|
||||
component.TryFlush();
|
||||
}
|
||||
}
|
||||
|
||||
void IDestroyAct.OnDestroy(DestructionEventArgs eventArgs)
|
||||
{
|
||||
TryEjectContents();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user