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

Document that object properties colors field is unused #15685

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion doc/lua_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9236,7 +9236,7 @@ Player properties need to be saved manually.
-- Deprecated usage of "wielditem" expects 'textures = {itemname}' (see 'visual' above).

colors = {},
-- Number of required colors depends on visual
-- Currently unused.

use_texture_alpha = false,
-- Use texture's alpha channel.
Expand Down
4 changes: 2 additions & 2 deletions src/client/content_cao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1404,8 +1404,8 @@ void GenericCAO::updateTextures(std::string mod)
});
}
// Set mesh color (only if lighting is disabled)
if (!m_prop.colors.empty() && m_prop.glow < 0)
sfan5 marked this conversation as resolved.
Show resolved Hide resolved
setMeshColor(mesh, m_prop.colors[0]);
if (m_prop.glow < 0)
setMeshColor(mesh, {255, 255, 255, 255});
}
}
// Prevent showing the player after changing texture
Expand Down
2 changes: 1 addition & 1 deletion src/object_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct ObjectProperties
/* member variables ordered roughly by size */

std::vector<std::string> textures;
std::vector<video::SColor> colors;
std::vector<video::SColor> colors; // Currently unused
cx384 marked this conversation as resolved.
Show resolved Hide resolved
// Values are BS=1
aabb3f collisionbox = aabb3f(-0.5f, -0.5f, -0.5f, 0.5f, 0.5f, 0.5f);
// Values are BS=1
Expand Down
Loading