Fix weather blocking in some instances (#14561)
This commit is contained in:
@@ -95,6 +95,7 @@ public sealed class WeatherOverlay : Overlay
|
||||
{
|
||||
var bodyQuery = _entManager.GetEntityQuery<PhysicsComponent>();
|
||||
var xformQuery = _entManager.GetEntityQuery<TransformComponent>();
|
||||
var weatherIgnoreQuery = _entManager.GetEntityQuery<IgnoreWeatherComponent>();
|
||||
|
||||
foreach (var grid in _mapManager.FindGridsIntersecting(mapId, worldAABB))
|
||||
{
|
||||
@@ -105,7 +106,7 @@ public sealed class WeatherOverlay : Overlay
|
||||
foreach (var tile in grid.GetTilesIntersecting(worldAABB))
|
||||
{
|
||||
// Ignored tiles for stencil
|
||||
if (_weather.CanWeatherAffect(grid, tile, bodyQuery))
|
||||
if (_weather.CanWeatherAffect(grid, tile, weatherIgnoreQuery, bodyQuery))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ public sealed class WeatherSystem : SharedWeatherSystem
|
||||
// If we don't have a nearest node don't play any sound.
|
||||
EntityCoordinates? nearestNode = null;
|
||||
var bodyQuery = GetEntityQuery<PhysicsComponent>();
|
||||
var weatherIgnoreQuery = GetEntityQuery<IgnoreWeatherComponent>();
|
||||
var visited = new HashSet<Vector2i>();
|
||||
|
||||
while (frontier.TryDequeue(out var node))
|
||||
@@ -89,7 +90,7 @@ public sealed class WeatherSystem : SharedWeatherSystem
|
||||
if (!visited.Add(node.GridIndices))
|
||||
continue;
|
||||
|
||||
if (!CanWeatherAffect(grid, node, bodyQuery))
|
||||
if (!CanWeatherAffect(grid, node, weatherIgnoreQuery, bodyQuery))
|
||||
{
|
||||
// Add neighbors
|
||||
// TODO: Ideally we pick some deterministically random direction and use that
|
||||
|
||||
Reference in New Issue
Block a user