diff options
author | x2048 <codeforsmile@gmail.com> | 2022-05-01 17:21:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-01 17:21:00 +0200 |
commit | c7bcebb62856ae5fdb23a13e6fa1052eae700ddf (patch) | |
tree | e949364a5cf6c70276a3a84564fe68adcc9ce2c6 /src | |
parent | a89afe1229e327da3c397a3912b2d43d2196ea2b (diff) | |
download | minetest-c7bcebb62856ae5fdb23a13e6fa1052eae700ddf.tar.gz minetest-c7bcebb62856ae5fdb23a13e6fa1052eae700ddf.tar.bz2 minetest-c7bcebb62856ae5fdb23a13e6fa1052eae700ddf.zip |
Initialize wield mesh colors when changing item. (#12254)
Fixes #12245
Diffstat (limited to 'src')
-rw-r--r-- | src/client/wieldmesh.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/client/wieldmesh.cpp b/src/client/wieldmesh.cpp index ab6fc9281..d5c191935 100644 --- a/src/client/wieldmesh.cpp +++ b/src/client/wieldmesh.cpp @@ -457,6 +457,10 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che material.setFlag(video::EMF_BILINEAR_FILTER, m_bilinear_filter); material.setFlag(video::EMF_TRILINEAR_FILTER, m_trilinear_filter); } + + // initialize the color + if (!m_lighting) + setColor(video::SColor(0xFFFFFFFF)); return; } else { if (!def.inventory_image.empty()) { @@ -469,6 +473,10 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che m_colors.emplace_back(); // overlay is white, if present m_colors.emplace_back(true, video::SColor(0xFFFFFFFF)); + + // initialize the color + if (!m_lighting) + setColor(video::SColor(0xFFFFFFFF)); return; } |