Skip to content

Commit

Permalink
Grow dirt_with_snow instead of dirt_with_grass if snow is above it
Browse files Browse the repository at this point in the history
  • Loading branch information
PilzAdam committed Apr 23, 2013
1 parent 4a9b8aa commit c03c296
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/content_abm.cpp
Expand Up @@ -51,11 +51,15 @@ class GrowGrassABM : public ActiveBlockModifier
ServerMap *map = &env->getServerMap();

MapNode n_top = map->getNodeNoEx(p+v3s16(0,1,0));
content_t c_snow = ndef->getId("snow");
if(ndef->get(n_top).light_propagates &&
!ndef->get(n_top).isLiquid() &&
n_top.getLightBlend(env->getDayNightRatio(), ndef) >= 13)
{
n.setContent(ndef->getId("mapgen_dirt_with_grass"));
if(c_snow != CONTENT_IGNORE && n_top.getContent() == c_snow)
n.setContent(ndef->getId("dirt_with_snow"));
else
n.setContent(ndef->getId("mapgen_dirt_with_grass"));
map->addNodeWithEvent(p, n);
}
}
Expand Down

0 comments on commit c03c296

Please sign in to comment.