Gas Analyzer can now scan pipes/devices along with the environment (#10976)
This commit is contained in:
@@ -44,6 +44,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
SubscribeLocalEvent<GasTankComponent, EntParentChangedMessage>(OnParentChange);
|
||||
SubscribeLocalEvent<GasTankComponent, GasTankSetPressureMessage>(OnGasTankSetPressure);
|
||||
SubscribeLocalEvent<GasTankComponent, GasTankToggleInternalsMessage>(OnGasTankToggleInternals);
|
||||
SubscribeLocalEvent<GasTankComponent, GasAnalyzerScanEvent>(OnAnalyzed);
|
||||
}
|
||||
|
||||
private void OnGasShutdown(EntityUid uid, GasTankComponent component, ComponentShutdown args)
|
||||
@@ -87,7 +88,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
// When an item is moved from hands -> pockets, the container removal briefly dumps the item on the floor.
|
||||
// So this is a shitty fix, where the parent check is just delayed. But this really needs to get fixed
|
||||
// properly at some point.
|
||||
// properly at some point.
|
||||
component.CheckUser = true;
|
||||
}
|
||||
|
||||
@@ -323,5 +324,13 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
return GetInternalsComponent(component) != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the gas mixture for the gas analyzer
|
||||
/// </summary>
|
||||
private void OnAnalyzed(EntityUid uid, GasTankComponent component, GasAnalyzerScanEvent args)
|
||||
{
|
||||
args.GasMixtures = new Dictionary<string, GasMixture?> { {Name(uid), component.Air} };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user