From 90d793f8f369bf1431d7a915198cd49b98bbe2d7 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 23 Jul 2011 16:55:26 +0300 Subject: extended content-type range --- src/mapblock.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/mapblock.cpp') diff --git a/src/mapblock.cpp b/src/mapblock.cpp index 647a17756..ead26dd1f 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -242,7 +242,7 @@ bool MapBlock::propagateSunlight(core::map & light_sources, // Check if node above block has sunlight try{ MapNode n = getNodeParent(v3s16(x, MAP_BLOCKSIZE, z)); - if(n.d == CONTENT_IGNORE || n.getLight(LIGHTBANK_DAY) != LIGHT_SUN) + if(n.getContent() == CONTENT_IGNORE || n.getLight(LIGHTBANK_DAY) != LIGHT_SUN) { no_sunlight = true; } @@ -260,8 +260,8 @@ bool MapBlock::propagateSunlight(core::map & 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; } @@ -322,14 +322,14 @@ bool MapBlock::propagateSunlight(core::map & 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; @@ -473,7 +473,7 @@ void MapBlock::updateDayNightDiff() for(u32 i=0; i=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; @@ -560,7 +560,7 @@ void MapBlock::serialize(std::ostream &os, u8 version) SharedBuffer materialdata(nodecount); for(u32 i=0; i lightdata(nodecount); for(u32 i=0; i