Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in WorldHeightMap::Parse_Blend_Tile_Data function #1112

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/platform/w3dengine/client/worldheightmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
Loading