Fix explosion bug (#11824)
This commit is contained in:
@@ -186,7 +186,11 @@ public sealed class ExplosionGridTileFlood : ExplosionTileFlood
|
|||||||
NewBlockedTiles.Add(tile);
|
NewBlockedTiles.Add(tile);
|
||||||
|
|
||||||
// At what explosion iteration would this blocker be destroyed?
|
// At what explosion iteration would this blocker be destroyed?
|
||||||
var clearIteration = iteration + (int) MathF.Ceiling(tileData.ExplosionTolerance[_typeIndex] / _intensityStepSize);
|
var required = tileData.ExplosionTolerance[_typeIndex];
|
||||||
|
if (required > _maxIntensity)
|
||||||
|
return; // blocker is never destroyed.
|
||||||
|
|
||||||
|
var clearIteration = iteration + (int) MathF.Ceiling(required / _intensityStepSize);
|
||||||
if (FreedTileLists.TryGetValue(clearIteration, out var list))
|
if (FreedTileLists.TryGetValue(clearIteration, out var list))
|
||||||
list.Add(tile);
|
list.Add(tile);
|
||||||
else
|
else
|
||||||
@@ -275,7 +279,7 @@ public sealed class ExplosionGridTileFlood : ExplosionTileFlood
|
|||||||
|
|
||||||
// This tile has one or more airtight entities anchored to it blocking the explosion from traveling in
|
// This tile has one or more airtight entities anchored to it blocking the explosion from traveling in
|
||||||
// some directions. First, check whether this blocker can even be destroyed by this explosion?
|
// some directions. First, check whether this blocker can even be destroyed by this explosion?
|
||||||
if (sealIntegrity > _maxIntensity || float.IsNaN(sealIntegrity))
|
if (sealIntegrity > _maxIntensity)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// At what explosion iteration would this blocker be destroyed?
|
// At what explosion iteration would this blocker be destroyed?
|
||||||
|
|||||||
@@ -147,10 +147,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
|||||||
foreach (var (type, value) in explosionType.DamagePerIntensity.DamageDict)
|
foreach (var (type, value) in explosionType.DamagePerIntensity.DamageDict)
|
||||||
{
|
{
|
||||||
if (!damageable.Damage.DamageDict.ContainsKey(type))
|
if (!damageable.Damage.DamageDict.ContainsKey(type))
|
||||||
{
|
|
||||||
explosionTolerance[index] = float.MaxValue;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
var ev = new GetExplosionResistanceEvent(explosionType.ID);
|
var ev = new GetExplosionResistanceEvent(explosionType.ID);
|
||||||
RaiseLocalEvent(uid, ev, false);
|
RaiseLocalEvent(uid, ev, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user