hotfix lube crash

stackoverflowing
This commit is contained in:
Kara D
2021-11-22 23:21:20 -07:00
parent 07039faae4
commit 567ed44408
2 changed files with 9 additions and 6 deletions

View File

@@ -125,7 +125,7 @@ namespace Content.Server.Fluids.Components
}
public static PuddleComponent? SpillAt(this TileRef tileRef, Solution solution, string prototype,
bool overflow = true, bool sound = true)
bool overflow = true, bool sound = true, bool noTileReact = false)
{
if (solution.TotalVolume <= 0) return null;
@@ -139,11 +139,14 @@ namespace Content.Server.Fluids.Components
var gridId = tileRef.GridIndex;
if (!mapManager.TryGetGrid(gridId, out var mapGrid)) return null; // Let's not spill to invalid grids.
// First, do all tile reactions
foreach (var reagent in solution.Contents.ToArray())
if (!noTileReact)
{
var proto = prototypeManager.Index<ReagentPrototype>(reagent.ReagentId);
proto.ReactionTile(tileRef, reagent.Quantity);
// First, do all tile reactions
foreach (var reagent in solution.Contents.ToArray())
{
var proto = prototypeManager.Index<ReagentPrototype>(reagent.ReagentId);
proto.ReactionTile(tileRef, reagent.Quantity);
}
}
// Tile reactions used up everything.