1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix building on top of (pointable && buildable_to) nodes

This commit is contained in:
Perttu Ahola 2012-07-23 20:41:40 +03:00
parent 9af9d8f5d0
commit c009aa3a22
2 changed files with 41 additions and 14 deletions

View file

@ -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);