a little dungeon and mud tweak

This commit is contained in:
darkrose 2013-04-27 14:34:28 +10:00
parent 4ce27a2dc5
commit 9680962529
2 changed files with 12 additions and 3 deletions

View File

@ -1020,7 +1020,10 @@ void ServerEnvironment::step(float dtime)
//if(myrand()%20 == 0) //if(myrand()%20 == 0)
{ {
MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0));
if(content_features(n_top).air_equivalent == false) if (
n_top.getContent() != CONTENT_AIR &&
n_top.getContent() != CONTENT_IGNORE
)
{ {
n.setContent(CONTENT_MUD); n.setContent(CONTENT_MUD);
m_map->addNodeWithEvent(p, n); m_map->addNodeWithEvent(p, n);

View File

@ -914,11 +914,17 @@ static void make_dungeon1(VoxelManipulator &vmanip, PseudoRandom &random)
u32 room_count = random.range(2,7); u32 room_count = random.range(2,7);
for(u32 i=0; i<room_count; i++) for(u32 i=0; i<room_count; i++)
{ {
// Make a room to the determined place
make_room1(vmanip, roomsize, roomplace);
v3s16 room_center = roomplace + v3s16(roomsize.X/2,1,roomsize.Z/2); v3s16 room_center = roomplace + v3s16(roomsize.X/2,1,roomsize.Z/2);
// dungeons should only be made in stone, so if room_center isn't stone
// stop making a dungeon
if (vmanip.m_data[vmanip.m_area.index(room_center)].getContent() != CONTENT_STONE)
break;
// Make a room to the determined place
make_room1(vmanip, roomsize, roomplace);
// Place torch at room center (for testing) // Place torch at room center (for testing)
//vmanip.m_data[vmanip.m_area.index(room_center)] = MapNode(CONTENT_TORCH); //vmanip.m_data[vmanip.m_area.index(room_center)] = MapNode(CONTENT_TORCH);