mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-06 17:58:05 +02:00
Fix grid chunk bugs (#4525)
* Fix grid rendering * Use TileChangedEvent * Other empty chunk fixes * Remove assert Good ol integration tests at it again, adding invalid components
This commit is contained in:
@@ -126,11 +126,12 @@ namespace Robust.Shared.GameObjects
|
||||
/// <summary>
|
||||
/// Creates a new instance of this class.
|
||||
/// </summary>
|
||||
public TileChangedEvent(EntityUid uid, TileRef newTile, Tile oldTile)
|
||||
public TileChangedEvent(EntityUid uid, TileRef newTile, Tile oldTile, Vector2i chunkIndex)
|
||||
{
|
||||
Entity = uid;
|
||||
NewTile = newTile;
|
||||
OldTile = oldTile;
|
||||
ChunkIndex = chunkIndex;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -147,36 +148,10 @@ namespace Robust.Shared.GameObjects
|
||||
/// Old tile that was replaced.
|
||||
/// </summary>
|
||||
public readonly Tile OldTile;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Arguments for when a one or more tiles on a grid are modified at once.
|
||||
/// </summary>
|
||||
public sealed class GridModifiedEvent : EntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The id of the grid being changed.
|
||||
/// </summary>
|
||||
public EntityUid GridEnt { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Grid being changed.
|
||||
/// The index of the grid-chunk that this tile belongs to.
|
||||
/// </summary>
|
||||
public MapGridComponent Grid { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Set of tiles that were modified.
|
||||
/// </summary>
|
||||
public IReadOnlyCollection<(Vector2i position, Tile tile)> Modified { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of this class.
|
||||
/// </summary>
|
||||
public GridModifiedEvent(EntityUid gridEnt, MapGridComponent grid, IReadOnlyCollection<(Vector2i position, Tile tile)> modified)
|
||||
{
|
||||
GridEnt = gridEnt;
|
||||
Grid = grid;
|
||||
Modified = modified;
|
||||
}
|
||||
public readonly Vector2i ChunkIndex;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user