mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Allow place_param2 = 0 node placement predictions (#13787)
The placement prediction value 0 was accidentally ignored and made the clients fall back to automatic rotation based on the node paramtype2 value. This now changes the internal representation to properly indicate the disabled state (e.g. 'nil' in Lua).
This commit is contained in:
@@ -443,7 +443,8 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che
|
||||
default: {
|
||||
// Render non-trivial drawtypes like the actual node
|
||||
MapNode n(id);
|
||||
n.setParam2(def.place_param2);
|
||||
if (def.place_param2)
|
||||
n.setParam2(*def.place_param2);
|
||||
|
||||
mesh = createSpecialNodeMesh(client, n, &m_colors, f);
|
||||
changeToMesh(mesh);
|
||||
@@ -638,7 +639,8 @@ void getItemMesh(Client *client, const ItemStack &item, ItemMesh *result)
|
||||
default: {
|
||||
// Render non-trivial drawtypes like the actual node
|
||||
MapNode n(id);
|
||||
n.setParam2(def.place_param2);
|
||||
if (def.place_param2)
|
||||
n.setParam2(*def.place_param2);
|
||||
|
||||
mesh = createSpecialNodeMesh(client, n, &result->buffer_colors, f);
|
||||
scaleMesh(mesh, v3f(0.12, 0.12, 0.12));
|
||||
|
Reference in New Issue
Block a user