]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/mapblockobject.cpp
updated CMakeList.txts a bit
[dragonfireclient.git] / src / mapblockobject.cpp
index 009163a18e1d834abfb6901cb34809f0f6b658e8..071a14b0cdb3b497d586f057fb6a1503377b0f20 100644 (file)
@@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "map.h"
 #include "inventory.h"
 #include "utility.h"
+#include "mapblock.h"
 
 /*
        MapBlockObject
@@ -160,8 +161,8 @@ void MovingObject::move(float dtime, v3f acceleration)
                for(s16 x = oldpos_i.X - 1; x <= oldpos_i.X + 1; x++)
                {
                        try{
-                               if(content_walkable(m_block->getNodeParent(v3s16(x,y,z)).d)
-                                               == false)
+                               MapNode n = m_block->getNodeParent(v3s16(x,y,z));
+                               if(content_features(n).walkable == false)
                                        continue;
                        }
                        catch(InvalidPositionException &e)
@@ -856,16 +857,7 @@ bool MapBlockObjectList::wrapObject(MapBlockObject *object)
        assert(m_objects.find(object->m_id) != NULL);
        assert(m_objects[object->m_id] == object);
 
-       NodeContainer *parentcontainer = m_block->getParent();
-       // This will only work if the parent is the map
-       if(parentcontainer->nodeContainerId() != NODECONTAINER_ID_MAP)
-       {
-               dstream<<"WARNING: Wrapping object not possible: "
-                               "MapBlock's parent is not map"<<std::endl;
-               return true;
-       }
-       // OK, we have the map!
-       Map *map = (Map*)parentcontainer;
+       Map *map = m_block->getParent();
        
        // Calculate blockpos on map
        v3s16 oldblock_pos_i_on_map = m_block->getPosRelative();