This id must be owned by the child mapgen and never be set to a misc value by a developer
Also use nullptr in some places
// Create our MapgenParams
MapgenParams *params = Mapgen::createMapgenParams(mgtype);
- if (params == NULL)
- return NULL;
+ if (!params)
+ return nullptr;
params->mgtype = mgtype;
{
switch (mgtype) {
case MAPGEN_CARPATHIAN:
- return new MapgenCarpathian(mgid, (MapgenCarpathianParams *)params, emerge);
+ return new MapgenCarpathian((MapgenCarpathianParams *)params, emerge);
case MAPGEN_FLAT:
- return new MapgenFlat(mgid, (MapgenFlatParams *)params, emerge);
+ return new MapgenFlat((MapgenFlatParams *)params, emerge);
case MAPGEN_FRACTAL:
- return new MapgenFractal(mgid, (MapgenFractalParams *)params, emerge);
+ return new MapgenFractal((MapgenFractalParams *)params, emerge);
case MAPGEN_SINGLENODE:
- return new MapgenSinglenode(mgid, (MapgenSinglenodeParams *)params, emerge);
+ return new MapgenSinglenode((MapgenSinglenodeParams *)params, emerge);
case MAPGEN_V5:
- return new MapgenV5(mgid, (MapgenV5Params *)params, emerge);
+ return new MapgenV5((MapgenV5Params *)params, emerge);
case MAPGEN_V6:
- return new MapgenV6(mgid, (MapgenV6Params *)params, emerge);
+ return new MapgenV6((MapgenV6Params *)params, emerge);
case MAPGEN_V7:
- return new MapgenV7(mgid, (MapgenV7Params *)params, emerge);
+ return new MapgenV7((MapgenV7Params *)params, emerge);
case MAPGEN_VALLEYS:
- return new MapgenValleys(mgid, (MapgenValleysParams *)params, emerge);
+ return new MapgenValleys((MapgenValleysParams *)params, emerge);
default:
- return NULL;
+ return nullptr;
}
}
case MAPGEN_VALLEYS:
return new MapgenValleysParams;
default:
- return NULL;
+ return nullptr;
}
}
///////////////////////////////////////////////////////////////////////////////
-MapgenCarpathian::MapgenCarpathian(
- int mapgenid, MapgenCarpathianParams *params, EmergeManager *emerge)
- : MapgenBasic(mapgenid, params, emerge)
+MapgenCarpathian::MapgenCarpathian(MapgenCarpathianParams *params, EmergeManager *emerge)
+ : MapgenBasic(MAPGEN_CARPATHIAN, params, emerge)
{
base_level = params->base_level;
class MapgenCarpathian : public MapgenBasic
{
public:
- MapgenCarpathian(int mapgenid, MapgenCarpathianParams *params,
- EmergeManager *emerge);
+ MapgenCarpathian(MapgenCarpathianParams *params, EmergeManager *emerge);
~MapgenCarpathian();
virtual MapgenType getType() const { return MAPGEN_CARPATHIAN; }
///////////////////////////////////////////////////////////////////////////////////////
-MapgenFlat::MapgenFlat(int mapgenid, MapgenFlatParams *params, EmergeManager *emerge)
- : MapgenBasic(mapgenid, params, emerge)
+MapgenFlat::MapgenFlat(MapgenFlatParams *params, EmergeManager *emerge)
+ : MapgenBasic(MAPGEN_FLAT, params, emerge)
{
spflags = params->spflags;
ground_level = params->ground_level;
class MapgenFlat : public MapgenBasic
{
public:
- MapgenFlat(int mapgenid, MapgenFlatParams *params, EmergeManager *emerge);
+ MapgenFlat(MapgenFlatParams *params, EmergeManager *emerge);
~MapgenFlat();
virtual MapgenType getType() const { return MAPGEN_FLAT; }
///////////////////////////////////////////////////////////////////////////////////////
-MapgenFractal::MapgenFractal(int mapgenid, MapgenFractalParams *params, EmergeManager *emerge)
- : MapgenBasic(mapgenid, params, emerge)
+MapgenFractal::MapgenFractal(MapgenFractalParams *params, EmergeManager *emerge)
+ : MapgenBasic(MAPGEN_FRACTAL, params, emerge)
{
spflags = params->spflags;
cave_width = params->cave_width;
class MapgenFractal : public MapgenBasic
{
public:
- MapgenFractal(int mapgenid, MapgenFractalParams *params, EmergeManager *emerge);
+ MapgenFractal(MapgenFractalParams *params, EmergeManager *emerge);
~MapgenFractal();
virtual MapgenType getType() const { return MAPGEN_FRACTAL; }
#include "emerge.h"
-MapgenSinglenode::MapgenSinglenode(int mapgenid,
- MapgenParams *params, EmergeManager *emerge)
- : Mapgen(mapgenid, params, emerge)
+MapgenSinglenode::MapgenSinglenode(MapgenParams *params, EmergeManager *emerge)
+ : Mapgen(MAPGEN_SINGLENODE, params, emerge)
{
const NodeDefManager *ndef = emerge->ndef;
content_t c_node;
u8 set_light;
- MapgenSinglenode(int mapgenid, MapgenParams *params, EmergeManager *emerge);
+ MapgenSinglenode(MapgenParams *params, EmergeManager *emerge);
~MapgenSinglenode() = default;
virtual MapgenType getType() const { return MAPGEN_SINGLENODE; }
};
-MapgenV5::MapgenV5(int mapgenid, MapgenV5Params *params, EmergeManager *emerge)
- : MapgenBasic(mapgenid, params, emerge)
+MapgenV5::MapgenV5(MapgenV5Params *params, EmergeManager *emerge)
+ : MapgenBasic(MAPGEN_V5, params, emerge)
{
spflags = params->spflags;
cave_width = params->cave_width;
class MapgenV5 : public MapgenBasic
{
public:
- MapgenV5(int mapgenid, MapgenV5Params *params, EmergeManager *emerge);
+ MapgenV5(MapgenV5Params *params, EmergeManager *emerge);
~MapgenV5();
virtual MapgenType getType() const { return MAPGEN_V5; }
/////////////////////////////////////////////////////////////////////////////
-MapgenV6::MapgenV6(int mapgenid, MapgenV6Params *params, EmergeManager *emerge)
- : Mapgen(mapgenid, params, emerge)
+MapgenV6::MapgenV6(MapgenV6Params *params, EmergeManager *emerge)
+ : Mapgen(MAPGEN_V6, params, emerge)
{
m_emerge = emerge;
ystride = csize.X; //////fix this
content_t c_stair_cobble;
content_t c_stair_desert_stone;
- MapgenV6(int mapgenid, MapgenV6Params *params, EmergeManager *emerge);
+ MapgenV6(MapgenV6Params *params, EmergeManager *emerge);
~MapgenV6();
virtual MapgenType getType() const { return MAPGEN_V6; }
////////////////////////////////////////////////////////////////////////////////
-MapgenV7::MapgenV7(int mapgenid, MapgenV7Params *params, EmergeManager *emerge)
- : MapgenBasic(mapgenid, params, emerge)
+MapgenV7::MapgenV7(MapgenV7Params *params, EmergeManager *emerge)
+ : MapgenBasic(MAPGEN_V7, params, emerge)
{
spflags = params->spflags;
mount_zero_level = params->mount_zero_level;
class MapgenV7 : public MapgenBasic {
public:
- MapgenV7(int mapgenid, MapgenV7Params *params, EmergeManager *emerge);
+ MapgenV7(MapgenV7Params *params, EmergeManager *emerge);
~MapgenV7();
virtual MapgenType getType() const { return MAPGEN_V7; }
};
-MapgenValleys::MapgenValleys(int mapgenid, MapgenValleysParams *params,
- EmergeManager *emerge)
- : MapgenBasic(mapgenid, params, emerge)
+MapgenValleys::MapgenValleys(MapgenValleysParams *params, EmergeManager *emerge)
+ : MapgenBasic(MAPGEN_VALLEYS, params, emerge)
{
// NOTE: MapgenValleys has a hard dependency on BiomeGenOriginal
m_bgen = (BiomeGenOriginal *)biomegen;
class MapgenValleys : public MapgenBasic {
public:
- MapgenValleys(int mapgenid, MapgenValleysParams *params,
+ MapgenValleys(MapgenValleysParams *params,
EmergeManager *emerge);
~MapgenValleys();