Skip to content

Commit c03c296

Browse files
committedApr 23, 2013
Grow dirt_with_snow instead of dirt_with_grass if snow is above it
1 parent 4a9b8aa commit c03c296

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/content_abm.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,15 @@ class GrowGrassABM : public ActiveBlockModifier
5151
ServerMap *map = &env->getServerMap();
5252

5353
MapNode n_top = map->getNodeNoEx(p+v3s16(0,1,0));
54+
content_t c_snow = ndef->getId("snow");
5455
if(ndef->get(n_top).light_propagates &&
5556
!ndef->get(n_top).isLiquid() &&
5657
n_top.getLightBlend(env->getDayNightRatio(), ndef) >= 13)
5758
{
58-
n.setContent(ndef->getId("mapgen_dirt_with_grass"));
59+
if(c_snow != CONTENT_IGNORE && n_top.getContent() == c_snow)
60+
n.setContent(ndef->getId("dirt_with_snow"));
61+
else
62+
n.setContent(ndef->getId("mapgen_dirt_with_grass"));
5963
map->addNodeWithEvent(p, n);
6064
}
6165
}

0 commit comments

Comments
 (0)