Don't allow placing CONTENT_IGNORE with Map::setNode() because it is never useful...
authorPerttu Ahola <celeron55@gmail.com>
Fri, 25 Nov 2011 15:42:41 +0000 (17:42 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:51 +0000 (19:13 +0200)
src/map.cpp

index 822b3f659bf06aa6a10e7afdc3d34a096ec2cf2a..3f858ed67e58b0ac4fed3851125f3ab7c358a710 100644 (file)
@@ -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);
 }