From 9f66004c44e36e9c5a13d02988597c79faf74873 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 20 Jul 2022 20:22:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20invalid=20Z=20range=20on?= =?UTF-8?q?=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/UUoaDesigns.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Client/UUoaDesigns.pas b/Client/UUoaDesigns.pas index c1008fd..ce49ecd 100644 --- a/Client/UUoaDesigns.pas +++ b/Client/UUoaDesigns.pas @@ -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