aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-04-23 19:02:41 +0200
committerPilzAdam <pilzadam@minetest.net>2013-04-23 19:02:41 +0200
commitc03c296dc7afe0e4ded65484221072ad6715e2be (patch)
treeb44fe1618bae2b1dfe13307dd60218bad2610ed9 /src
parent4a9b8aae5e54e4cb6395771868a83bfd0f72c11a (diff)
downloadminetest-c03c296dc7afe0e4ded65484221072ad6715e2be.tar.gz
minetest-c03c296dc7afe0e4ded65484221072ad6715e2be.tar.bz2
minetest-c03c296dc7afe0e4ded65484221072ad6715e2be.zip
Grow dirt_with_snow instead of dirt_with_grass if snow is above it
Diffstat (limited to 'src')
-rw-r--r--src/content_abm.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/content_abm.cpp b/src/content_abm.cpp
index ccd9ca19c..e20201dcf 100644
--- a/src/content_abm.cpp
+++ b/src/content_abm.cpp
@@ -51,11 +51,15 @@ public:
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);
}
}