aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-07-23 20:41:40 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-07-23 20:42:08 +0300
commitc009aa3a22b0a2d5790898ac05c92d429c82f94a (patch)
treec57c79d6ca212a19b6652800762799f41986645e /src
parent9af9d8f5d003d87aeea269b88463e7c20cc7bda0 (diff)
downloadminetest-c009aa3a22b0a2d5790898ac05c92d429c82f94a.tar.gz
minetest-c009aa3a22b0a2d5790898ac05c92d429c82f94a.tar.bz2
minetest-c009aa3a22b0a2d5790898ac05c92d429c82f94a.zip
Fix building on top of (pointable && buildable_to) nodes
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 19c4707de..7d93e3db2 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -2304,6 +2304,13 @@ void the_game(
<<playeritem.name<<" is "
<<def.node_placement_prediction<<std::endl;
v3s16 p = neighbourpos;
+ // Place inside node itself if buildable_to
+ try{
+ MapNode n_under = map.getNode(nodepos);
+ if(nodedef->get(n_under).buildable_to)
+ p = nodepos;
+ }catch(InvalidPositionException &e){}
+ // Find id of predicted node
content_t id;
bool found =
nodedef->getId(def.node_placement_prediction, id);