#include "map.h"
#include "inventory.h"
#include "utility.h"
+#include "mapblock.h"
/*
MapBlockObject
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)
buf->getMaterial().setFlag(video::EMF_LIGHTING, false);
buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false);
buf->getMaterial().setTexture
- (0, driver->getTexture(porting::getDataPath("rat.png").c_str()));
+ (0, driver->getTexture(getTexturePath("rat.png").c_str()));
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true);
buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
// Set material
buf->getMaterial().setFlag(video::EMF_LIGHTING, false);
//buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false);
- buf->getMaterial().setTexture(0, driver->getTexture(porting::getDataPath("player.png").c_str()));
+ buf->getMaterial().setTexture(0, driver->getTexture(getTexturePath("player.png").c_str()));
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true);
//buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
// Set material
buf->getMaterial().setFlag(video::EMF_LIGHTING, false);
//buf->getMaterial().setFlag(video::EMF_BACK_FACE_CULLING, false);
- buf->getMaterial().setTexture(0, driver->getTexture(porting::getDataPath("player_back.png").c_str()));
+ buf->getMaterial().setTexture(0, driver->getTexture(getTexturePath("player_back.png").c_str()));
buf->getMaterial().setFlag(video::EMF_BILINEAR_FILTER, false);
buf->getMaterial().setFlag(video::EMF_FOG_ENABLE, true);
buf->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
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();