@@ -107,8 +107,16 @@ public partial class AtmosphereSystem
|
||||
else
|
||||
RaiseLocalEvent(ref ev);
|
||||
|
||||
if (ev.Handled)
|
||||
return ev.Mixtures;
|
||||
|
||||
// Default to a space mixture... This is a space game, after all!
|
||||
return ev.Mixtures ?? new GasMixture?[tiles.Count];
|
||||
ev.Mixtures ??= new GasMixture?[tiles.Count];
|
||||
for (var i = 0; i < tiles.Count; i++)
|
||||
{
|
||||
ev.Mixtures[i] ??= GasMixture.SpaceGas;
|
||||
}
|
||||
return ev.Mixtures;
|
||||
}
|
||||
|
||||
public GasMixture? GetTileMixture(EntityUid? gridUid, EntityUid? mapUid, Vector2i tile, bool excite = false)
|
||||
|
||||
@@ -192,7 +192,11 @@ public sealed partial class AtmosphereSystem
|
||||
{
|
||||
var tile = args.Tiles[i];
|
||||
if (!component.Tiles.TryGetValue(tile, out var atmosTile))
|
||||
{
|
||||
// need to get map atmosphere
|
||||
args.Handled = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (args.Excite)
|
||||
component.InvalidatedCoords.Add(tile);
|
||||
|
||||
@@ -32,17 +32,14 @@ public partial class AtmosphereSystem
|
||||
|
||||
private void MapGetTileMixtures(EntityUid uid, MapAtmosphereComponent component, ref GetTileMixturesMethodEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
if (args.Handled || component.Mixture == null)
|
||||
return;
|
||||
args.Handled = true;
|
||||
args.Mixtures = new GasMixture?[args.Tiles.Count];
|
||||
|
||||
if (component.Mixture == null)
|
||||
return;
|
||||
args.Mixtures ??= new GasMixture?[args.Tiles.Count];
|
||||
|
||||
for (var i = 0; i < args.Tiles.Count; i++)
|
||||
{
|
||||
args.Mixtures[i] = component.Mixture.Clone();
|
||||
args.Mixtures[i] ??= component.Mixture.Clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user