aboutsummaryrefslogtreecommitdiff
path: root/src/client/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r--src/client/game.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index 6a4bff61a..b4926d9bf 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -3462,7 +3462,9 @@ bool Game::nodePlacement(const ItemDefinition &selected_def,
param2 = dir.Z < 0 ? 5 : 4;
}
} else if (predicted_f.param_type_2 == CPT2_FACEDIR ||
- predicted_f.param_type_2 == CPT2_COLORED_FACEDIR) {
+ predicted_f.param_type_2 == CPT2_COLORED_FACEDIR ||
+ predicted_f.param_type_2 == CPT2_4DIR ||
+ predicted_f.param_type_2 == CPT2_COLORED_4DIR) {
v3s16 dir = nodepos - floatToInt(client->getEnv().getLocalPlayer()->getPosition(), BS);
if (abs(dir.X) > abs(dir.Z)) {
@@ -3501,6 +3503,7 @@ bool Game::nodePlacement(const ItemDefinition &selected_def,
// Apply color
if (!place_param2 && (predicted_f.param_type_2 == CPT2_COLOR
|| predicted_f.param_type_2 == CPT2_COLORED_FACEDIR
+ || predicted_f.param_type_2 == CPT2_COLORED_4DIR
|| predicted_f.param_type_2 == CPT2_COLORED_WALLMOUNTED)) {
const auto &indexstr = selected_item.metadata.
getString("palette_index", 0);
@@ -3514,6 +3517,9 @@ bool Game::nodePlacement(const ItemDefinition &selected_def,
} else if (predicted_f.param_type_2 == CPT2_COLORED_FACEDIR) {
// param2 = pure palette index + other
param2 = (index & 0xe0) | (param2 & 0x1f);
+ } else if (predicted_f.param_type_2 == CPT2_COLORED_4DIR) {
+ // param2 = pure palette index + other
+ param2 = (index & 0xfc) | (param2 & 0x03);
}
}
}