@@ -107,8 +107,16 @@ public partial class AtmosphereSystem
|
|||||||
else
|
else
|
||||||
RaiseLocalEvent(ref ev);
|
RaiseLocalEvent(ref ev);
|
||||||
|
|
||||||
|
if (ev.Handled)
|
||||||
|
return ev.Mixtures;
|
||||||
|
|
||||||
// Default to a space mixture... This is a space game, after all!
|
// 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)
|
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];
|
var tile = args.Tiles[i];
|
||||||
if (!component.Tiles.TryGetValue(tile, out var atmosTile))
|
if (!component.Tiles.TryGetValue(tile, out var atmosTile))
|
||||||
|
{
|
||||||
|
// need to get map atmosphere
|
||||||
|
args.Handled = false;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.Excite)
|
if (args.Excite)
|
||||||
component.InvalidatedCoords.Add(tile);
|
component.InvalidatedCoords.Add(tile);
|
||||||
|
|||||||
@@ -32,17 +32,14 @@ public partial class AtmosphereSystem
|
|||||||
|
|
||||||
private void MapGetTileMixtures(EntityUid uid, MapAtmosphereComponent component, ref GetTileMixturesMethodEvent args)
|
private void MapGetTileMixtures(EntityUid uid, MapAtmosphereComponent component, ref GetTileMixturesMethodEvent args)
|
||||||
{
|
{
|
||||||
if (args.Handled)
|
if (args.Handled || component.Mixture == null)
|
||||||
return;
|
return;
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
args.Mixtures = new GasMixture?[args.Tiles.Count];
|
args.Mixtures ??= new GasMixture?[args.Tiles.Count];
|
||||||
|
|
||||||
if (component.Mixture == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (var i = 0; i < args.Tiles.Count; i++)
|
for (var i = 0; i < args.Tiles.Count; i++)
|
||||||
{
|
{
|
||||||
args.Mixtures[i] = component.Mixture.Clone();
|
args.Mixtures[i] ??= component.Mixture.Clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -249,10 +249,6 @@ namespace Content.Server.Doors.Systems
|
|||||||
// achieving all this using existing atmos functions, and the functionality is too specialized to bother
|
// achieving all this using existing atmos functions, and the functionality is too specialized to bother
|
||||||
// adding new public atmos system functions.
|
// adding new public atmos system functions.
|
||||||
|
|
||||||
|
|
||||||
// TODO redo this with planet/map atmospheres
|
|
||||||
// there is probably a faster way of doing this. tbh I kinda hate the atmos method events for making
|
|
||||||
// accessing tile data directly such a pain. Dealting with maps will make it even more painful.
|
|
||||||
List<Vector2i> tiles = new(4);
|
List<Vector2i> tiles = new(4);
|
||||||
List<AtmosDirection> directions = new(4);
|
List<AtmosDirection> directions = new(4);
|
||||||
for (var i = 0; i < Atmospherics.Directions; i++)
|
for (var i = 0; i < Atmospherics.Directions; i++)
|
||||||
@@ -270,7 +266,7 @@ namespace Content.Server.Doors.Systems
|
|||||||
if (airtight.AirBlockedDirection != AtmosDirection.All)
|
if (airtight.AirBlockedDirection != AtmosDirection.All)
|
||||||
tiles.Add(pos);
|
tiles.Add(pos);
|
||||||
|
|
||||||
var gasses = _atmosSystem.GetTileMixtures(gridAtmosphere.Owner, null, tiles);
|
var gasses = _atmosSystem.GetTileMixtures(gridAtmosphere.Owner, xform.MapUid, tiles);
|
||||||
if (gasses == null)
|
if (gasses == null)
|
||||||
return (false, false);
|
return (false, false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user