mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +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:
@@ -3627,10 +3627,10 @@ bool Game::nodePlacement(const ItemDefinition &selected_def,
|
||||
// Compare core.item_place_node() for what the server does with param2
|
||||
MapNode predicted_node(id, 0, 0);
|
||||
|
||||
const u8 place_param2 = selected_def.place_param2;
|
||||
const auto place_param2 = selected_def.place_param2;
|
||||
|
||||
if (place_param2) {
|
||||
predicted_node.setParam2(place_param2);
|
||||
predicted_node.setParam2(*place_param2);
|
||||
} else if (predicted_f.param_type_2 == CPT2_WALLMOUNTED ||
|
||||
predicted_f.param_type_2 == CPT2_COLORED_WALLMOUNTED) {
|
||||
v3s16 dir = nodepos - neighborpos;
|
||||
|
Reference in New Issue
Block a user