diff --git a/Client/Map/ClientLandscape.cs b/Client/Map/ClientLandscape.cs index a280ae3..e3ddee9 100644 --- a/Client/Map/ClientLandscape.cs +++ b/Client/Map/ClientLandscape.cs @@ -96,4 +96,9 @@ protected override Block LoadBlock(ushort x, ushort y) return block; } + + public override void LogError(string message) + { + //TODO: Log error + } } \ No newline at end of file diff --git a/Server/Map/ServerLandscape.cs b/Server/Map/ServerLandscape.cs index abf6e4e..730c782 100644 --- a/Server/Map/ServerLandscape.cs +++ b/Server/Map/ServerLandscape.cs @@ -572,4 +572,9 @@ public void Dispose() Dispose(true); GC.SuppressFinalize(this); } + + public override void LogError(string message) + { + _logger.LogError(message); + } } \ No newline at end of file diff --git a/Shared/BaseLandscape.cs b/Shared/BaseLandscape.cs index 92e3976..f02ee20 100644 --- a/Shared/BaseLandscape.cs +++ b/Shared/BaseLandscape.cs @@ -283,4 +283,6 @@ public void OnStaticTileHued(StaticTile staticTile, ushort newHue) } protected abstract Block LoadBlock(ushort x, ushort y); + + public abstract void LogError(string message); } \ No newline at end of file diff --git a/Shared/StaticBlock.cs b/Shared/StaticBlock.cs index 38fbf54..61669b3 100644 --- a/Shared/StaticBlock.cs +++ b/Shared/StaticBlock.cs @@ -101,7 +101,12 @@ public void SortTiles(ref StaticTiles[] tiledata) continue; foreach (var tile in staticTiles) { - tile.UpdatePriority(tiledata[tile.Id]); + if(tiledata.Length < tile.Id) + tile.UpdatePriority(tiledata[tile.Id]); + else + { + Landscape.LogError($"StaticTile with invalid Id: {tile.Id}@{tile.X},{tile.Y},{tile.Z}"); + } } staticTiles.Sort((tile1, tile2) => tile1.PriorityZ.CompareTo(tile2.PriorityZ)); var i = staticTiles.Count;