🐛 Fix invalid Z range on load

This commit is contained in:
Andreas Schneider 2022-07-20 20:22:29 +02:00
parent b83c5f4b2d
commit 9f66004c44
1 changed files with 4 additions and 1 deletions

View File

@ -62,6 +62,9 @@ type
implementation
uses
Math;
function ReadString(AStream: TStream): String;
var
nonNullFlag: Byte;
@ -104,7 +107,7 @@ begin
tile.TileID := ReadInt;
tile.X := ReadInt;
tile.Y := ReadInt;
tile.Z := ReadInt;
tile.Z := EnsureRange(ReadInt, -128, 127);
ReadInt; // Level; unused
if version = 1 then