Skip to content

Commit

Permalink
Initialize wield mesh colors when changing item. (minetest#12254)
Browse files Browse the repository at this point in the history
  • Loading branch information
x2048 authored May 1, 2022
1 parent a89afe1 commit c7bcebb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/client/wieldmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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;
}

Expand Down

0 comments on commit c7bcebb

Please sign in to comment.