* regression fix, papyrus should appear again now

This commit is contained in:
Nils Dagsson Moskopp 2011-07-13 16:21:20 +02:00
parent 1e88a16dd5
commit a676493f46

@ -1863,7 +1863,7 @@ void make_block(BlockMakeData *data)
//s16 y = find_ground_level(data->vmanip, v2s16(x,z)); //s16 y = find_ground_level(data->vmanip, v2s16(x,z));
s16 y = find_ground_level_from_noise(data->seed, v2s16(x,z), 4); s16 y = find_ground_level_from_noise(data->seed, v2s16(x,z), 4);
// Don't make a tree under water level // Don't make a tree under water level
if(y < WATER_LEVEL - 1) if(y < WATER_LEVEL)
continue; continue;
// Make sure tree fits (only trees whose starting point is // Make sure tree fits (only trees whose starting point is
// at this block are added) // at this block are added)
@ -1878,7 +1878,7 @@ void make_block(BlockMakeData *data)
{ {
u32 i = data->vmanip->m_area.index(p); u32 i = data->vmanip->m_area.index(p);
MapNode *n = &data->vmanip->m_data[i]; MapNode *n = &data->vmanip->m_data[i];
if(n->d != CONTENT_AIR && n->d != CONTENT_IGNORE) if(n->d != CONTENT_AIR && n->d != CONTENT_WATERSOURCE && n->d != CONTENT_IGNORE)
{ {
found = true; found = true;
break; break;
@ -1896,22 +1896,19 @@ void make_block(BlockMakeData *data)
continue; continue;
// Papyrus grows only on mud and in water // Papyrus grows only on mud and in water
if(n->d == CONTENT_MUD && y == WATER_LEVEL - 1) if(n->d == CONTENT_MUD && y <= WATER_LEVEL)
{ {
p.Y++; p.Y++;
make_papyrus(vmanip, p); make_papyrus(vmanip, p);
} }
// Don't make a tree under water level // Trees grow only on mud and grass, on land
if(y < WATER_LEVEL) else if((n->d == CONTENT_MUD || n->d == CONTENT_GRASS) && y > WATER_LEVEL + 2)
continue;
// Trees grow only on mud and grass
if(n->d == CONTENT_MUD || n->d == CONTENT_GRASS)
{ {
p.Y++; p.Y++;
make_tree(vmanip, p); make_tree(vmanip, p);
} }
// Cactii grow only on sand // Cactii grow only on sand, on land
else if(n->d == CONTENT_SAND) else if(n->d == CONTENT_SAND && y > WATER_LEVEL + 2)
{ {
p.Y++; p.Y++;
make_cactus(vmanip, p); make_cactus(vmanip, p);