diff options
Diffstat (limited to 'src/mapblock.cpp')
-rw-r--r-- | src/mapblock.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mapblock.cpp b/src/mapblock.cpp index cdbd54525..49d215bf6 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -242,7 +242,7 @@ bool MapBlock::propagateSunlight(core::map<v3s16, bool> & light_sources, // Check if node above block has sunlight try{ MapNode n = getNodeParent(v3s16(x, MAP_BLOCKSIZE, z)); - if(n.d == CONTENT_IGNORE) + if(n.getContent() == CONTENT_IGNORE) { // Trust heuristics no_sunlight = is_underground; @@ -265,8 +265,8 @@ bool MapBlock::propagateSunlight(core::map<v3s16, bool> & light_sources, else { MapNode n = getNode(v3s16(x, MAP_BLOCKSIZE-1, z)); - //if(n.d == CONTENT_WATER || n.d == CONTENT_WATERSOURCE) - if(content_features(n.d).sunlight_propagates == false) + //if(n.getContent() == CONTENT_WATER || n.getContent() == CONTENT_WATERSOURCE) + if(content_features(n).sunlight_propagates == false) { no_sunlight = true; } @@ -327,14 +327,14 @@ bool MapBlock::propagateSunlight(core::map<v3s16, bool> & light_sources, bool upper_is_air = false; try { - if(getNodeParent(pos+v3s16(0,1,0)).d == CONTENT_AIR) + if(getNodeParent(pos+v3s16(0,1,0)).getContent() == CONTENT_AIR) upper_is_air = true; } catch(InvalidPositionException &e) { } // Turn mud into grass - if(upper_is_air && n.d == CONTENT_MUD + if(upper_is_air && n.getContent() == CONTENT_MUD && current_light == LIGHT_SUN) { n.d = CONTENT_GRASS; @@ -478,7 +478,7 @@ void MapBlock::updateDayNightDiff() for(u32 i=0; i<MAP_BLOCKSIZE*MAP_BLOCKSIZE*MAP_BLOCKSIZE; i++) { MapNode &n = data[i]; - if(n.d != CONTENT_AIR) + if(n.getContent() != CONTENT_AIR) { only_air = false; break; @@ -501,8 +501,8 @@ s16 MapBlock::getGroundLevel(v2s16 p2d) s16 y = MAP_BLOCKSIZE-1; for(; y>=0; y--) { - //if(is_ground_content(getNodeRef(p2d.X, y, p2d.Y).d)) - if(content_features(getNodeRef(p2d.X, y, p2d.Y).d).walkable) + MapNode n = getNodeRef(p2d.X, y, p2d.Y); + if(content_features(n).walkable) { if(y == MAP_BLOCKSIZE-1) return -2; @@ -565,7 +565,7 @@ void MapBlock::serialize(std::ostream &os, u8 version) SharedBuffer<u8> materialdata(nodecount); for(u32 i=0; i<nodecount; i++) { - materialdata[i] = data[i].d; + materialdata[i] = data[i].param0; } compress(materialdata, os, version); @@ -573,7 +573,7 @@ void MapBlock::serialize(std::ostream &os, u8 version) SharedBuffer<u8> lightdata(nodecount); for(u32 i=0; i<nodecount; i++) { - lightdata[i] = data[i].param; + lightdata[i] = data[i].param1; } compress(lightdata, os, version); @@ -720,7 +720,7 @@ void MapBlock::deSerialize(std::istream &is, u8 version) ("MapBlock::deSerialize: invalid format"); for(u32 i=0; i<s.size(); i++) { - data[i].d = s[i]; + data[i].param0 = s[i]; } } { @@ -733,7 +733,7 @@ void MapBlock::deSerialize(std::istream &is, u8 version) ("MapBlock::deSerialize: invalid format"); for(u32 i=0; i<s.size(); i++) { - data[i].param = s[i]; + data[i].param1 = s[i]; } } |