mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-19 22:49:01 +03:00
Try fix random explosion test failures (#23158)
(cherry picked from commit c2c76c2035b2da8cf6aa4948a44aeac123a2588b)
This commit is contained in:
@@ -3,6 +3,7 @@ using Robust.Client.Graphics;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Graphics.RSI;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -18,6 +19,7 @@ public sealed class ExplosionOverlaySystem : EntitySystem
|
||||
[Dependency] private readonly IResourceCache _resCache = default!;
|
||||
[Dependency] private readonly IOverlayManager _overlayMan = default!;
|
||||
[Dependency] private readonly SharedPointLightSystem _lights = default!;
|
||||
[Dependency] private readonly IMapManager _mapMan = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -65,15 +67,20 @@ public sealed class ExplosionOverlaySystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
// spawn in a client-side light source at the epicenter
|
||||
var lightEntity = Spawn("ExplosionLight", component.Epicenter);
|
||||
var light = _lights.EnsureLight(lightEntity);
|
||||
// Map may have been deleted.
|
||||
if (_mapMan.MapExists(component.Epicenter.MapId))
|
||||
{
|
||||
// spawn in a client-side light source at the epicenter
|
||||
var lightEntity = Spawn("ExplosionLight", component.Epicenter);
|
||||
var light = _lights.EnsureLight(lightEntity);
|
||||
|
||||
_lights.SetRadius(lightEntity, component.Intensity.Count, light);
|
||||
_lights.SetEnergy(lightEntity, component.Intensity.Count, light);
|
||||
_lights.SetColor(lightEntity, type.LightColor, light);
|
||||
textures.LightEntity = lightEntity;
|
||||
}
|
||||
|
||||
_lights.SetRadius(lightEntity, component.Intensity.Count, light);
|
||||
_lights.SetEnergy(lightEntity, component.Intensity.Count, light);
|
||||
_lights.SetColor(lightEntity, type.LightColor, light);
|
||||
|
||||
textures.LightEntity = lightEntity;
|
||||
textures.FireColor = type.FireColor;
|
||||
textures.IntensityPerState = type.IntensityPerState;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user