continue;
u32 i = vm->m_area.index(p);
+ content_t c = vm->m_data[i].getContent();
+ if (!ndef->get(c).is_ground_content)
+ continue;
if (large_cave) {
int full_ymin = node_min.Y - MAP_BLOCKSIZE;
}
} else {
// Don't replace air or water or lava or ignore
- content_t c = vm->m_data[i].getContent();
if (c == CONTENT_IGNORE || c == CONTENT_AIR ||
c == c_water_source || c == c_lava_source)
continue;
// Don't replace air, water, lava, or ice
content_t c = vm->m_data[i].getContent();
- if (c == CONTENT_AIR || c == c_water_source ||
- c == c_lava_source || c == c_ice)
+ if (!ndef->get(c).is_ground_content || c == CONTENT_AIR ||
+ c == c_water_source || c == c_lava_source || c == c_ice)
continue;
if (large_cave) {
return getParam2() & LIQUID_LEVEL_MASK;
if(f.leveled || f.param_type_2 == CPT2_LEVELED) {
u8 level = getParam2() & LEVELED_MASK;
- if(level) return level;
- if(f.leveled > LEVELED_MAX) return LEVELED_MAX;
+ if(level)
+ return level;
+ if(f.leveled > LEVELED_MAX)
+ return LEVELED_MAX;
return f.leveled; //default
}
return 0;
return 0;
}
const ContentFeatures &f = nodemgr->get(*this);
- if ( f.param_type_2 == CPT2_FLOWINGLIQUID
+ if (f.param_type_2 == CPT2_FLOWINGLIQUID
|| f.liquid_type == LIQUID_FLOWING
|| f.liquid_type == LIQUID_SOURCE) {
if (level >= LIQUID_LEVEL_SOURCE) {
param0 = readU16(source+0);
param1 = readU8(source+2);
param2 = readU8(source+3);
- }
- else{
+ }else{
param0 = readU8(source+0);
param1 = readU8(source+1);
param2 = readU8(source+2);
// Set CONTENT_AIR
{
ContentFeatures f;
- f.name = "air";
- f.drawtype = NDT_AIRLIKE;
- f.param_type = CPT_LIGHT;
- f.light_propagates = true;
+ f.name = "air";
+ f.drawtype = NDT_AIRLIKE;
+ f.param_type = CPT_LIGHT;
+ f.light_propagates = true;
f.sunlight_propagates = true;
- f.walkable = false;
- f.pointable = false;
- f.diggable = false;
- f.buildable_to = true;
+ f.walkable = false;
+ f.pointable = false;
+ f.diggable = false;
+ f.buildable_to = true;
+ f.is_ground_content = true;
// Insert directly into containers
content_t c = CONTENT_AIR;
m_content_features[c] = f;
// Set CONTENT_IGNORE
{
ContentFeatures f;
- f.name = "ignore";
- f.drawtype = NDT_AIRLIKE;
- f.param_type = CPT_NONE;
- f.light_propagates = false;
+ f.name = "ignore";
+ f.drawtype = NDT_AIRLIKE;
+ f.param_type = CPT_NONE;
+ f.light_propagates = false;
f.sunlight_propagates = false;
- f.walkable = false;
- f.pointable = false;
- f.diggable = false;
- // A way to remove accidental CONTENT_IGNOREs
- f.buildable_to = true;
+ f.walkable = false;
+ f.pointable = false;
+ f.diggable = false;
+ f.buildable_to = true; // A way to remove accidental CONTENT_IGNOREs
+ f.is_ground_content = true;
// Insert directly into containers
content_t c = CONTENT_IGNORE;
m_content_features[c] = f;