aboutsummaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-25 17:42:41 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:51 +0200
commit74770ab71818a16b49274ac2261c0577cbdccfce (patch)
treef18389df2bec4d3af26f18a7c16b3d55425507c8 /src/map.cpp
parent6153a2fb104a2b4eb88885690f3d5e1826320643 (diff)
downloadminetest-74770ab71818a16b49274ac2261c0577cbdccfce.tar.gz
minetest-74770ab71818a16b49274ac2261c0577cbdccfce.tar.bz2
minetest-74770ab71818a16b49274ac2261c0577cbdccfce.zip
Don't allow placing CONTENT_IGNORE with Map::setNode() because it is never useful and is only caused by bugs.
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 822b3f659..3f858ed67 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -208,6 +208,15 @@ void Map::setNode(v3s16 p, MapNode & n)
v3s16 blockpos = getNodeBlockPos(p);
MapBlock *block = getBlockNoCreate(blockpos);
v3s16 relpos = p - blockpos*MAP_BLOCKSIZE;
+ // Never allow placing CONTENT_IGNORE, it fucks up stuff
+ if(n.getContent() == CONTENT_IGNORE){
+ errorstream<<"Map::setNode(): Not allowing to place CONTENT_IGNORE"
+ <<" while trying to replace \""
+ <<m_gamedef->ndef()->get(block->getNodeNoCheck(relpos)).name
+ <<"\" at "<<PP(p)<<" (block "<<PP(blockpos)<<")"<<std::endl;
+ debug_stacks_print_to(errorstream);
+ return;
+ }
block->setNodeNoCheck(relpos, n);
}