From f76a1da913985f225eeb4a88ffe40cd4d5765fb1 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sun, 11 Feb 2024 14:17:12 +0100 Subject: [PATCH] Fix bug in WorldHeightMap::Parse_Blend_Tile_Data function --- src/platform/w3dengine/client/worldheightmap.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/platform/w3dengine/client/worldheightmap.cpp b/src/platform/w3dengine/client/worldheightmap.cpp index 398f3d072..b56406644 100644 --- a/src/platform/w3dengine/client/worldheightmap.cpp +++ b/src/platform/w3dengine/client/worldheightmap.cpp @@ -689,11 +689,12 @@ bool WorldHeightMap::Parse_Blend_Tile_Data(DataChunkInput &file, DataChunkInfo * captainslog_dbgassert(m_numTextureClasses > 0 || m_numTextureClasses < 16193, "Unlikely m_numTextureClasses."); for (int i = 0; i < m_numTextureClasses; i++) { - m_textureClasses[i].global_texture_class = 0xFFFFFFFF; + m_textureClasses[i].global_texture_class = -1; m_textureClasses[i].first_tile = file.Read_Int32(); m_textureClasses[i].num_tiles = file.Read_Int32(); m_textureClasses[i].width = file.Read_Int32(); - file.Read_Int32(); + // #BUGFIX Actually use returned value to set blend edge tile. + m_textureClasses[i].is_blend_edge_tile = file.Read_Int32(); m_textureClasses[i].name = file.Read_AsciiString(); Read_Tex_Class(&m_textureClasses[i], m_sourceTiles); } @@ -706,7 +707,7 @@ bool WorldHeightMap::Parse_Blend_Tile_Data(DataChunkInput &file, DataChunkInfo * m_numEdgeTextureClasses = file.Read_Int32(); for (int i = 0; i < m_numEdgeTextureClasses; i++) { - m_edgeTextureClasses[i].global_texture_class = 0xFFFFFFFF; + m_edgeTextureClasses[i].global_texture_class = -1; m_edgeTextureClasses[i].first_tile = file.Read_Int32(); m_edgeTextureClasses[i].num_tiles = file.Read_Int32(); m_edgeTextureClasses[i].width = file.Read_Int32(); @@ -736,7 +737,7 @@ bool WorldHeightMap::Parse_Blend_Tile_Data(DataChunkInput &file, DataChunkInfo * if (info->version >= 4) { m_blendedTiles[i].custom_blend_edge_class = file.Read_Int32(); } else { - m_blendedTiles[i].custom_blend_edge_class = 0xFFFFFFFF; + m_blendedTiles[i].custom_blend_edge_class = -1; } int flag = file.Read_Int32();