]> git.lizzy.rs Git - dragonfireclient.git/blob - src/mapgen_v7.cpp
9ff2fbe66e89fde952fe04b5f3985fe2e6b0511c
[dragonfireclient.git] / src / mapgen_v7.cpp
1 /*
2 Minetest
3 Copyright (C) 2010-2015 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
4 Copyright (C) 2010-2015 paramat, Matt Gregory
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21
22 #include "mapgen.h"
23 #include "voxel.h"
24 #include "noise.h"
25 #include "mapblock.h"
26 #include "mapnode.h"
27 #include "map.h"
28 #include "content_sao.h"
29 #include "nodedef.h"
30 #include "voxelalgorithms.h"
31 //#include "profiler.h" // For TimeTaker
32 #include "settings.h" // For g_settings
33 #include "emerge.h"
34 #include "dungeongen.h"
35 #include "cavegen.h"
36 #include "treegen.h"
37 #include "mg_biome.h"
38 #include "mg_ore.h"
39 #include "mg_decoration.h"
40 #include "mapgen_v7.h"
41
42
43 FlagDesc flagdesc_mapgen_v7[] = {
44         {"mountains", MGV7_MOUNTAINS},
45         {"ridges",    MGV7_RIDGES},
46         {NULL,        0}
47 };
48
49
50 ///////////////////////////////////////////////////////////////////////////////
51
52
53 MapgenV7::MapgenV7(int mapgenid, MapgenParams *params, EmergeManager *emerge)
54         : MapgenBasic(mapgenid, params, emerge)
55 {
56         MapgenV7Params *sp = (MapgenV7Params *)params->sparams;
57
58         this->spflags    = sp->spflags;
59         this->cave_width = sp->cave_width;
60
61         //// Terrain noise
62         noise_terrain_base    = new Noise(&sp->np_terrain_base,    seed, csize.X, csize.Z);
63         noise_terrain_alt     = new Noise(&sp->np_terrain_alt,     seed, csize.X, csize.Z);
64         noise_terrain_persist = new Noise(&sp->np_terrain_persist, seed, csize.X, csize.Z);
65         noise_height_select   = new Noise(&sp->np_height_select,   seed, csize.X, csize.Z);
66         noise_filler_depth    = new Noise(&sp->np_filler_depth,    seed, csize.X, csize.Z);
67         noise_mount_height    = new Noise(&sp->np_mount_height,    seed, csize.X, csize.Z);
68         noise_ridge_uwater    = new Noise(&sp->np_ridge_uwater,    seed, csize.X, csize.Z);
69
70         //// 3d terrain noise
71         // 1-up 1-down overgeneration
72         noise_mountain = new Noise(&sp->np_mountain, seed, csize.X, csize.Y + 2, csize.Z);
73         noise_ridge    = new Noise(&sp->np_ridge,    seed, csize.X, csize.Y + 2, csize.Z);
74
75         MapgenBasic::np_cave1 = sp->np_cave1;
76         MapgenBasic::np_cave2 = sp->np_cave2;
77 }
78
79
80 MapgenV7::~MapgenV7()
81 {
82         delete noise_terrain_base;
83         delete noise_terrain_persist;
84         delete noise_height_select;
85         delete noise_terrain_alt;
86         delete noise_filler_depth;
87         delete noise_mount_height;
88         delete noise_ridge_uwater;
89         delete noise_mountain;
90         delete noise_ridge;
91 }
92
93
94 MapgenV7Params::MapgenV7Params()
95 {
96         spflags    = MGV7_MOUNTAINS | MGV7_RIDGES;
97         cave_width = 0.3;
98
99         np_terrain_base    = NoiseParams(4,    70,  v3f(600,  600,  600),  82341, 5, 0.6,  2.0);
100         np_terrain_alt     = NoiseParams(4,    25,  v3f(600,  600,  600),  5934,  5, 0.6,  2.0);
101         np_terrain_persist = NoiseParams(0.6,  0.1, v3f(2000, 2000, 2000), 539,   3, 0.6,  2.0);
102         np_height_select   = NoiseParams(-8,   16,  v3f(500,  500,  500),  4213,  6, 0.7,  2.0);
103         np_filler_depth    = NoiseParams(0,    1.2, v3f(150,  150,  150),  261,   3, 0.7,  2.0);
104         np_mount_height    = NoiseParams(256,  112, v3f(1000, 1000, 1000), 72449, 3, 0.6,  2.0);
105         np_ridge_uwater    = NoiseParams(0,    1,   v3f(1000, 1000, 1000), 85039, 5, 0.6,  2.0);
106         np_mountain        = NoiseParams(-0.6, 1,   v3f(250,  350,  250),  5333,  5, 0.63, 2.0);
107         np_ridge           = NoiseParams(0,    1,   v3f(100,  100,  100),  6467,  4, 0.75, 2.0);
108         np_cave1           = NoiseParams(0,    12,  v3f(96,   96,   96),   52534, 4, 0.5,  2.0);
109         np_cave2           = NoiseParams(0,    12,  v3f(96,   96,   96),   10325, 4, 0.5,  2.0);
110 }
111
112
113 void MapgenV7Params::readParams(const Settings *settings)
114 {
115         settings->getFlagStrNoEx("mgv7_spflags",  spflags, flagdesc_mapgen_v7);
116         settings->getFloatNoEx("mgv7_cave_width", cave_width);
117
118         settings->getNoiseParams("mgv7_np_terrain_base",    np_terrain_base);
119         settings->getNoiseParams("mgv7_np_terrain_alt",     np_terrain_alt);
120         settings->getNoiseParams("mgv7_np_terrain_persist", np_terrain_persist);
121         settings->getNoiseParams("mgv7_np_height_select",   np_height_select);
122         settings->getNoiseParams("mgv7_np_filler_depth",    np_filler_depth);
123         settings->getNoiseParams("mgv7_np_mount_height",    np_mount_height);
124         settings->getNoiseParams("mgv7_np_ridge_uwater",    np_ridge_uwater);
125         settings->getNoiseParams("mgv7_np_mountain",        np_mountain);
126         settings->getNoiseParams("mgv7_np_ridge",           np_ridge);
127         settings->getNoiseParams("mgv7_np_cave1",           np_cave1);
128         settings->getNoiseParams("mgv7_np_cave2",           np_cave2);
129 }
130
131
132 void MapgenV7Params::writeParams(Settings *settings) const
133 {
134         settings->setFlagStr("mgv7_spflags",  spflags, flagdesc_mapgen_v7, U32_MAX);
135         settings->setFloat("mgv7_cave_width", cave_width);
136
137         settings->setNoiseParams("mgv7_np_terrain_base",    np_terrain_base);
138         settings->setNoiseParams("mgv7_np_terrain_alt",     np_terrain_alt);
139         settings->setNoiseParams("mgv7_np_terrain_persist", np_terrain_persist);
140         settings->setNoiseParams("mgv7_np_height_select",   np_height_select);
141         settings->setNoiseParams("mgv7_np_filler_depth",    np_filler_depth);
142         settings->setNoiseParams("mgv7_np_mount_height",    np_mount_height);
143         settings->setNoiseParams("mgv7_np_ridge_uwater",    np_ridge_uwater);
144         settings->setNoiseParams("mgv7_np_mountain",        np_mountain);
145         settings->setNoiseParams("mgv7_np_ridge",           np_ridge);
146         settings->setNoiseParams("mgv7_np_cave1",           np_cave1);
147         settings->setNoiseParams("mgv7_np_cave2",           np_cave2);
148 }
149
150
151 ///////////////////////////////////////////////////////////////////////////////
152
153
154 int MapgenV7::getSpawnLevelAtPoint(v2s16 p)
155 {
156         // Base terrain calculation
157         s16 y = baseTerrainLevelAtPoint(p.X, p.Y);
158
159         // Ridge/river terrain calculation
160         float width = 0.2;
161         float uwatern = NoisePerlin2D(&noise_ridge_uwater->np, p.X, p.Y, seed) * 2;
162         // if inside a river this is an unsuitable spawn point
163         if (fabs(uwatern) <= width)
164                 return MAX_MAP_GENERATION_LIMIT;
165
166         // Mountain terrain calculation
167         int iters = 128;
168         while (iters--) {
169                 if (!getMountainTerrainAtPoint(p.X, y + 1, p.Y)) {  // Air, y is ground level
170                         if (y <= water_level || y > water_level + 16)
171                                 return MAX_MAP_GENERATION_LIMIT;  // Unsuitable spawn point
172                         else
173                                 return y;
174                 }
175                 y++;
176         }
177
178         // Unsuitable spawn point, no ground surface found
179         return MAX_MAP_GENERATION_LIMIT;
180 }
181
182
183 void MapgenV7::makeChunk(BlockMakeData *data)
184 {
185         // Pre-conditions
186         assert(data->vmanip);
187         assert(data->nodedef);
188         assert(data->blockpos_requested.X >= data->blockpos_min.X &&
189                 data->blockpos_requested.Y >= data->blockpos_min.Y &&
190                 data->blockpos_requested.Z >= data->blockpos_min.Z);
191         assert(data->blockpos_requested.X <= data->blockpos_max.X &&
192                 data->blockpos_requested.Y <= data->blockpos_max.Y &&
193                 data->blockpos_requested.Z <= data->blockpos_max.Z);
194
195         this->generating = true;
196         this->vm   = data->vmanip;
197         this->ndef = data->nodedef;
198         //TimeTaker t("makeChunk");
199
200         v3s16 blockpos_min = data->blockpos_min;
201         v3s16 blockpos_max = data->blockpos_max;
202         node_min = blockpos_min * MAP_BLOCKSIZE;
203         node_max = (blockpos_max + v3s16(1, 1, 1)) * MAP_BLOCKSIZE - v3s16(1, 1, 1);
204         full_node_min = (blockpos_min - 1) * MAP_BLOCKSIZE;
205         full_node_max = (blockpos_max + 2) * MAP_BLOCKSIZE - v3s16(1, 1, 1);
206
207         blockseed = getBlockSeed2(full_node_min, seed);
208
209         // Generate terrain and ridges with initial heightmaps
210         s16 stone_surface_max_y = generateTerrain();
211
212         if (spflags & MGV7_RIDGES)
213                 generateRidgeTerrain();
214
215         // Update heightmap to include mountain terrain
216         updateHeightmap(node_min, node_max);
217
218         // Init biome generator, place biome-specific nodes, and build biomemap
219         biomegen->calcBiomeNoise(node_min);
220         biomegen->getBiomes(heightmap);
221         MgStoneType stone_type = generateBiomes();
222
223         if (flags & MG_CAVES)
224                 generateCaves(stone_surface_max_y, water_level);
225
226         if (flags & MG_DUNGEONS)
227                 generateDungeons(stone_surface_max_y, stone_type);
228
229         // Generate the registered decorations
230         if (flags & MG_DECORATIONS)
231                 m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
232
233         // Generate the registered ores
234         m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
235
236         // Sprinkle some dust on top after everything else was generated
237         dustTopNodes();
238
239         //printf("makeChunk: %dms\n", t.stop());
240
241         updateLiquid(&data->transforming_liquid, full_node_min, full_node_max);
242
243         if (flags & MG_LIGHT)
244                 calcLighting(node_min - v3s16(0, 1, 0), node_max + v3s16(0, 1, 0),
245                         full_node_min, full_node_max);
246
247         //setLighting(node_min - v3s16(1, 0, 1) * MAP_BLOCKSIZE,
248         //                      node_max + v3s16(1, 0, 1) * MAP_BLOCKSIZE, 0xFF);
249
250         this->generating = false;
251 }
252
253
254 float MapgenV7::baseTerrainLevelAtPoint(s16 x, s16 z)
255 {
256         float hselect = NoisePerlin2D(&noise_height_select->np, x, z, seed);
257         hselect = rangelim(hselect, 0.0, 1.0);
258
259         float persist = NoisePerlin2D(&noise_terrain_persist->np, x, z, seed);
260
261         noise_terrain_base->np.persist = persist;
262         float height_base = NoisePerlin2D(&noise_terrain_base->np, x, z, seed);
263
264         noise_terrain_alt->np.persist = persist;
265         float height_alt = NoisePerlin2D(&noise_terrain_alt->np, x, z, seed);
266
267         if (height_alt > height_base)
268                 return height_alt;
269
270         return (height_base * hselect) + (height_alt * (1.0 - hselect));
271 }
272
273
274 float MapgenV7::baseTerrainLevelFromMap(int index)
275 {
276         float hselect     = rangelim(noise_height_select->result[index], 0.0, 1.0);
277         float height_base = noise_terrain_base->result[index];
278         float height_alt  = noise_terrain_alt->result[index];
279
280         if (height_alt > height_base)
281                 return height_alt;
282
283         return (height_base * hselect) + (height_alt * (1.0 - hselect));
284 }
285
286
287 bool MapgenV7::getMountainTerrainAtPoint(s16 x, s16 y, s16 z)
288 {
289         float mnt_h_n = NoisePerlin2D(&noise_mount_height->np, x, z, seed);
290         float density_gradient = -((float)y / mnt_h_n);
291         float mnt_n = NoisePerlin3D(&noise_mountain->np, x, y, z, seed);
292
293         return mnt_n + density_gradient >= 0.0;
294 }
295
296
297 bool MapgenV7::getMountainTerrainFromMap(int idx_xyz, int idx_xz, s16 y)
298 {
299         float mounthn = noise_mount_height->result[idx_xz];
300         float density_gradient = -((float)y / mounthn);
301         float mountn = noise_mountain->result[idx_xyz];
302
303         return mountn + density_gradient >= 0.0;
304 }
305
306
307 int MapgenV7::generateTerrain()
308 {
309         MapNode n_air(CONTENT_AIR);
310         MapNode n_stone(c_stone);
311         MapNode n_water(c_water_source);
312
313         //// Calculate noise for terrain generation
314         noise_terrain_persist->perlinMap2D(node_min.X, node_min.Z);
315         float *persistmap = noise_terrain_persist->result;
316
317         noise_terrain_base->perlinMap2D(node_min.X, node_min.Z, persistmap);
318         noise_terrain_alt->perlinMap2D(node_min.X, node_min.Z, persistmap);
319         noise_height_select->perlinMap2D(node_min.X, node_min.Z);
320
321         if (spflags & MGV7_MOUNTAINS) {
322                 noise_mountain->perlinMap3D(node_min.X, node_min.Y - 1, node_min.Z);
323                 noise_mount_height->perlinMap2D(node_min.X, node_min.Z);
324         }
325
326         //// Place nodes
327         v3s16 em = vm->m_area.getExtent();
328         s16 stone_surface_max_y = -MAX_MAP_GENERATION_LIMIT;
329         u32 index2d = 0;
330
331         for (s16 z = node_min.Z; z <= node_max.Z; z++)
332         for (s16 x = node_min.X; x <= node_max.X; x++, index2d++) {
333                 s16 surface_y = baseTerrainLevelFromMap(index2d);
334                 heightmap[index2d] = surface_y;  // Create base terrain heightmap
335
336                 if (surface_y > stone_surface_max_y)
337                         stone_surface_max_y = surface_y;
338
339                 u32 vi = vm->m_area.index(x, node_min.Y - 1, z);
340                 u32 index3d = (z - node_min.Z) * zstride_1u1d + (x - node_min.X);
341
342                 for (s16 y = node_min.Y - 1; y <= node_max.Y + 1; y++) {
343                         if (vm->m_data[vi].getContent() == CONTENT_IGNORE) {
344                                 if (y <= surface_y) {
345                                         vm->m_data[vi] = n_stone;  // Base terrain
346                                 } else if ((spflags & MGV7_MOUNTAINS) &&
347                                                 getMountainTerrainFromMap(index3d, index2d, y)) {
348                                         vm->m_data[vi] = n_stone;  // Mountain terrain
349                                         if (y > stone_surface_max_y)
350                                                 stone_surface_max_y = y;
351                                 } else if (y <= water_level) {
352                                         vm->m_data[vi] = n_water;
353                                 } else {
354                                         vm->m_data[vi] = n_air;
355                                 }
356                         }
357                         vm->m_area.add_y(em, vi, 1);
358                         index3d += ystride;
359                 }
360         }
361
362         return stone_surface_max_y;
363 }
364
365
366 void MapgenV7::generateRidgeTerrain()
367 {
368         if (node_max.Y < water_level - 16)
369                 return;
370
371         noise_ridge->perlinMap3D(node_min.X, node_min.Y - 1, node_min.Z);
372         noise_ridge_uwater->perlinMap2D(node_min.X, node_min.Z);
373
374         MapNode n_water(c_water_source);
375         MapNode n_air(CONTENT_AIR);
376         u32 index = 0;
377         float width = 0.2;
378
379         for (s16 z = node_min.Z; z <= node_max.Z; z++)
380         for (s16 y = node_min.Y - 1; y <= node_max.Y + 1; y++) {
381                 u32 vi = vm->m_area.index(node_min.X, y, z);
382                 for (s16 x = node_min.X; x <= node_max.X; x++, index++, vi++) {
383                         int j = (z - node_min.Z) * csize.X + (x - node_min.X);
384
385                         if (heightmap[j] < water_level - 16)  // Use base terrain heightmap
386                                 continue;
387
388                         float uwatern = noise_ridge_uwater->result[j] * 2;
389                         if (fabs(uwatern) > width)
390                                 continue;
391
392                         float altitude = y - water_level;
393                         float height_mod = (altitude + 17) / 2.5;
394                         float width_mod  = width - fabs(uwatern);
395                         float nridge = noise_ridge->result[index] * MYMAX(altitude, 0) / 7.0;
396
397                         if (nridge + width_mod * height_mod < 0.6)
398                                 continue;
399
400                         vm->m_data[vi] = (y > water_level) ? n_air : n_water;
401                 }
402         }
403 }
404
405
406 ////////////////////////////////////////////////////////////////////////////////
407 //// Code Boneyard
408 ////
409 //// Much of the stuff here has potential to become useful again at some point
410 //// in the future, but we don't want it to get lost or forgotten in version
411 //// control.
412 ////
413
414 #if 0
415 int MapgenV7::generateMountainTerrain(s16 ymax)
416 {
417         MapNode n_stone(c_stone);
418         u32 j = 0;
419
420         for (s16 z = node_min.Z; z <= node_max.Z; z++)
421         for (s16 y = node_min.Y - 1; y <= node_max.Y + 1; y++) {
422                 u32 vi = vm->m_area.index(node_min.X, y, z);
423                 for (s16 x = node_min.X; x <= node_max.X; x++) {
424                         int index = (z - node_min.Z) * csize.X + (x - node_min.X);
425                         content_t c = vm->m_data[vi].getContent();
426
427                         if (getMountainTerrainFromMap(j, index, y)
428                                         && (c == CONTENT_AIR || c == c_water_source)) {
429                                 vm->m_data[vi] = n_stone;
430                                 if (y > ymax)
431                                         ymax = y;
432                         }
433
434                         vi++;
435                         j++;
436                 }
437         }
438
439         return ymax;
440 }
441 #endif
442
443
444 #if 0
445 void MapgenV7::carveRivers() {
446         MapNode n_air(CONTENT_AIR), n_water_source(c_water_source);
447         MapNode n_stone(c_stone);
448         u32 index = 0;
449
450         int river_depth = 4;
451
452         for (s16 z = node_min.Z; z <= node_max.Z; z++)
453         for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
454                 float terrain_mod  = noise_terrain_mod->result[index];
455                 NoiseParams *np = noise_terrain_river->np;
456                 np.persist = noise_terrain_persist->result[index];
457                 float terrain_river = NoisePerlin2DNoTxfm(np, x, z, seed);
458                 float height = terrain_river * (1 - abs(terrain_mod)) *
459                                                 noise_terrain_river->np.scale;
460                 height = log(height * height); //log(h^3) is pretty interesting for terrain
461
462                 s16 y = heightmap[index];
463                 if (height < 1.0 && y > river_depth &&
464                         y - river_depth >= node_min.Y && y <= node_max.Y) {
465
466                         for (s16 ry = y; ry != y - river_depth; ry--) {
467                                 u32 vi = vm->m_area.index(x, ry, z);
468                                 vm->m_data[vi] = n_air;
469                         }
470
471                         u32 vi = vm->m_area.index(x, y - river_depth, z);
472                         vm->m_data[vi] = n_water_source;
473                 }
474         }
475 }
476 #endif
477
478
479 #if 0
480 void MapgenV7::addTopNodes()
481 {
482         v3s16 em = vm->m_area.getExtent();
483         s16 ntopnodes;
484         u32 index = 0;
485
486         for (s16 z = node_min.Z; z <= node_max.Z; z++)
487         for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
488                 Biome *biome = bmgr->biomes[biomemap[index]];
489
490                 //////////////////// First, add top nodes below the ridge
491                 s16 y = ridge_heightmap[index];
492
493                 // This cutoff is good enough, but not perfect.
494                 // It will cut off potentially placed top nodes at chunk boundaries
495                 if (y < node_min.Y)
496                         continue;
497                 if (y > node_max.Y) {
498                         y = node_max.Y; // Let's see if we can still go downward anyway
499                         u32 vi = vm->m_area.index(x, y, z);
500                         content_t c = vm->m_data[vi].getContent();
501                         if (ndef->get(c).walkable)
502                                 continue;
503                 }
504
505                 // N.B.  It is necessary to search downward since ridge_heightmap[i]
506                 // might not be the actual height, just the lowest part in the chunk
507                 // where a ridge had been carved
508                 u32 i = vm->m_area.index(x, y, z);
509                 for (; y >= node_min.Y; y--) {
510                         content_t c = vm->m_data[i].getContent();
511                         if (ndef->get(c).walkable)
512                                 break;
513                         vm->m_area.add_y(em, i, -1);
514                 }
515
516                 if (y != node_min.Y - 1 && y >= water_level) {
517                         ridge_heightmap[index] = y; //update ridgeheight
518                         ntopnodes = biome->top_depth;
519                         for (; y <= node_max.Y && ntopnodes; y++) {
520                                 ntopnodes--;
521                                 vm->m_data[i] = MapNode(biome->c_top);
522                                 vm->m_area.add_y(em, i, 1);
523                         }
524                         // If dirt, grow grass on it.
525                         if (y > water_level - 10 &&
526                                 vm->m_data[i].getContent() == CONTENT_AIR) {
527                                 vm->m_area.add_y(em, i, -1);
528                                 if (vm->m_data[i].getContent() == c_dirt)
529                                         vm->m_data[i] = MapNode(c_dirt_with_grass);
530                         }
531                 }
532
533                 //////////////////// Now, add top nodes on top of the ridge
534                 y = heightmap[index];
535                 if (y > node_max.Y) {
536                         y = node_max.Y; // Let's see if we can still go downward anyway
537                         u32 vi = vm->m_area.index(x, y, z);
538                         content_t c = vm->m_data[vi].getContent();
539                         if (ndef->get(c).walkable)
540                                 continue;
541                 }
542
543                 i = vm->m_area.index(x, y, z);
544                 for (; y >= node_min.Y; y--) {
545                         content_t c = vm->m_data[i].getContent();
546                         if (ndef->get(c).walkable)
547                                 break;
548                         vm->m_area.add_y(em, i, -1);
549                 }
550
551                 if (y != node_min.Y - 1) {
552                         ntopnodes = biome->top_depth;
553                         // Let's see if we've already added it...
554                         if (y == ridge_heightmap[index] + ntopnodes - 1)
555                                 continue;
556
557                         for (; y <= node_max.Y && ntopnodes; y++) {
558                                 ntopnodes--;
559                                 vm->m_data[i] = MapNode(biome->c_top);
560                                 vm->m_area.add_y(em, i, 1);
561                         }
562                         // If dirt, grow grass on it.
563                         if (y > water_level - 10 &&
564                                 vm->m_data[i].getContent() == CONTENT_AIR) {
565                                 vm->m_area.add_y(em, i, -1);
566                                 if (vm->m_data[i].getContent() == c_dirt)
567                                         vm->m_data[i] = MapNode(c_dirt_with_grass);
568                         }
569                 }
570         }
571 }
572 #endif