Salvage dungeons (#14520)
This commit is contained in:
@@ -319,6 +319,33 @@ namespace Content.Server.Decals
|
||||
return decalIds;
|
||||
}
|
||||
|
||||
public HashSet<(uint Index, Decal Decal)> GetDecalsIntersecting(EntityUid gridUid, Box2 bounds, DecalGridComponent? component = null)
|
||||
{
|
||||
var decalIds = new HashSet<(uint, Decal)>();
|
||||
var chunkCollection = ChunkCollection(gridUid, component);
|
||||
|
||||
if (chunkCollection == null)
|
||||
return decalIds;
|
||||
|
||||
var chunks = new ChunkIndicesEnumerator(bounds, ChunkSize);
|
||||
|
||||
while (chunks.MoveNext(out var chunkOrigin))
|
||||
{
|
||||
if (!chunkCollection.TryGetValue(chunkOrigin.Value, out var chunk))
|
||||
continue;
|
||||
|
||||
foreach (var (id, decal) in chunk.Decals)
|
||||
{
|
||||
if (!bounds.Contains(decal.Coordinates))
|
||||
continue;
|
||||
|
||||
decalIds.Add((id, decal));
|
||||
}
|
||||
}
|
||||
|
||||
return decalIds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Changes a decals position. Note this will actually result in a new decal being created, possibly on a new grid or chunk.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user