Roof data rework (#35388)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using Content.Shared.Light.Components;
|
||||
using Content.Shared.Light.EntitySystems;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Map;
|
||||
@@ -17,6 +19,7 @@ public abstract class SharedWeatherSystem : EntitySystem
|
||||
[Dependency] private readonly MetaDataSystem _metadata = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
|
||||
[Dependency] private readonly SharedRoofSystem _roof = default!;
|
||||
|
||||
private EntityQuery<BlockWeatherComponent> _blockQuery;
|
||||
|
||||
@@ -38,12 +41,12 @@ public abstract class SharedWeatherSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
public bool CanWeatherAffect(EntityUid uid, MapGridComponent grid, TileRef tileRef)
|
||||
public bool CanWeatherAffect(EntityUid uid, MapGridComponent grid, TileRef tileRef, RoofComponent? roofComp = null)
|
||||
{
|
||||
if (tileRef.Tile.IsEmpty)
|
||||
return true;
|
||||
|
||||
if ((tileRef.Tile.Flags & (byte) TileFlag.Roof) == (byte) TileFlag.Roof)
|
||||
if (Resolve(uid, ref roofComp, false) && _roof.IsRooved((uid, grid, roofComp), tileRef.GridIndices))
|
||||
return false;
|
||||
|
||||
var tileDef = (ContentTileDefinition) _tileDefManager[tileRef.Tile.TypeId];
|
||||
|
||||
Reference in New Issue
Block a user