Mapgen Indev: Fix segfault in cave generation due to uninitialized variable
authorkwolekr <kwolekr@minetest.net>
Mon, 9 Dec 2013 03:13:05 +0000 (22:13 -0500)
committerkwolekr <kwolekr@minetest.net>
Mon, 9 Dec 2013 03:13:05 +0000 (22:13 -0500)
src/mapgen_indev.cpp

index 7203fc85d7f1c34ea66d70bdbf733165ade97f75..a22e2522f08f2120aa6588ddb3c9c18be4a5033e 100644 (file)
@@ -274,7 +274,9 @@ void MapgenIndev::generateCaves(int max_stone_y) {
 
 CaveIndev::CaveIndev(MapgenIndev *mg, PseudoRandom *ps, PseudoRandom *ps2,
                                v3s16 node_min, bool is_large_cave) {
+       this->mg = mg;
        this->vm = mg->vm;
+       this->ndef = mg->ndef;
        this->water_level = mg->water_level;
        this->large_cave = is_large_cave;
        this->ps  = ps;