Disposals air + new atmos expose event (#6798)

Co-authored-by: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
mirrorcult
2022-02-19 17:42:01 -07:00
committed by GitHub
parent f23386ac55
commit 3e6bf54727
7 changed files with 77 additions and 5 deletions

View File

@@ -85,9 +85,15 @@ namespace Content.Server.Atmos.EntitySystems
foreach (var (exposed, transform) in EntityManager.EntityQuery<AtmosExposedComponent, TransformComponent>())
{
var tile = GetTileMixture(transform.Coordinates);
if (tile == null) continue;
var updateEvent = new AtmosExposedUpdateEvent(transform.Coordinates, tile);
// Used for things like disposals/cryo to change which air people are exposed to.
var airEvent = new AtmosExposedGetAirEvent();
RaiseLocalEvent(exposed.Owner, ref airEvent, false);
airEvent.Gas ??= GetTileMixture(transform.Coordinates);
if (airEvent.Gas == null)
continue;
var updateEvent = new AtmosExposedUpdateEvent(transform.Coordinates, airEvent.Gas);
RaiseLocalEvent(exposed.Owner, ref updateEvent);
}