From 8e918bb322ceb8dcb4101740391138191d490e6d Mon Sep 17 00:00:00 2001 From: Daroc Alden Date: Fri, 11 Mar 2022 15:22:49 -0500 Subject: [PATCH] Fix undefined behavior in TileLayer (#12125) Initialize the values properly --- src/client/tile.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/tile.h b/src/client/tile.h index 171fb0fd4..4e182c64b 100644 --- a/src/client/tile.h +++ b/src/client/tile.h @@ -194,6 +194,7 @@ struct TileLayer texture_id == other.texture_id && material_type == other.material_type && material_flags == other.material_flags && + has_color == other.has_color && color == other.color && scale == other.scale; } @@ -284,9 +285,9 @@ struct TileLayer * The color of the tile, or if the tile does not own * a color then the color of the node owning this tile. */ - video::SColor color; + video::SColor color = video::SColor(0, 0, 0, 0); - u8 scale; + u8 scale = 1; }; /*!