Fix weather blocking in some instances (#14561)

This commit is contained in:
metalgearsloth
2023-03-11 14:11:19 +11:00
committed by GitHub
parent 304ec2c8b3
commit 22ae0e7ed8
5 changed files with 26 additions and 4 deletions

View File

@@ -36,7 +36,11 @@ public abstract class SharedWeatherSystem : EntitySystem
}
}
public bool CanWeatherAffect(MapGridComponent grid, TileRef tileRef, EntityQuery<PhysicsComponent> bodyQuery)
public bool CanWeatherAffect(
MapGridComponent grid,
TileRef tileRef,
EntityQuery<IgnoreWeatherComponent> weatherIgnoreQuery,
EntityQuery<PhysicsComponent> bodyQuery)
{
if (tileRef.Tile.IsEmpty)
return true;
@@ -50,7 +54,10 @@ public abstract class SharedWeatherSystem : EntitySystem
while (anchoredEnts.MoveNext(out var ent))
{
if (bodyQuery.TryGetComponent(ent, out var body) && body.CanCollide)
if (!weatherIgnoreQuery.HasComponent(ent.Value) &&
bodyQuery.TryGetComponent(ent, out var body) &&
body.Hard &&
body.CanCollide)
{
return false;
}