aboutsummaryrefslogtreecommitdiff
path: root/src/mg_ore.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-11-08 23:40:18 -0500
committerkwolekr <kwolekr@minetest.net>2015-11-09 01:32:39 -0500
commitf3ac2517ea585d31d176070be25adf8a68624c87 (patch)
tree570c9c870424da3b12296576658f96f15377264a /src/mg_ore.cpp
parentc3e179f256246b4b5a86cd908dfc567a7ec454ee (diff)
downloadminetest-f3ac2517ea585d31d176070be25adf8a68624c87.tar.gz
minetest-f3ac2517ea585d31d176070be25adf8a68624c87.tar.bz2
minetest-f3ac2517ea585d31d176070be25adf8a68624c87.zip
Convert usages of PseudoRandom to PcgRandom for ore and deco placement
In addition to being a better random, this fixes #3228
Diffstat (limited to 'src/mg_ore.cpp')
-rw-r--r--src/mg_ore.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mg_ore.cpp b/src/mg_ore.cpp
index 16d97685a..6b6e0d7a7 100644
--- a/src/mg_ore.cpp
+++ b/src/mg_ore.cpp
@@ -126,7 +126,7 @@ size_t Ore::placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
void OreScatter::generate(MMVManip *vm, int mapseed, u32 blockseed,
v3s16 nmin, v3s16 nmax, u8 *biomemap)
{
- PseudoRandom pr(blockseed);
+ PcgRandom pr(blockseed);
MapNode n_ore(c_ore, 0, ore_param2);
u32 sizex = (nmax.X - nmin.X + 1);
@@ -175,7 +175,7 @@ void OreScatter::generate(MMVManip *vm, int mapseed, u32 blockseed,
void OreSheet::generate(MMVManip *vm, int mapseed, u32 blockseed,
v3s16 nmin, v3s16 nmax, u8 *biomemap)
{
- PseudoRandom pr(blockseed + 4234);
+ PcgRandom pr(blockseed + 4234);
MapNode n_ore(c_ore, 0, ore_param2);
u16 max_height = column_height_max;
@@ -240,7 +240,7 @@ OrePuff::~OrePuff()
void OrePuff::generate(MMVManip *vm, int mapseed, u32 blockseed,
v3s16 nmin, v3s16 nmax, u8 *biomemap)
{
- PseudoRandom pr(blockseed + 4234);
+ PcgRandom pr(blockseed + 4234);
MapNode n_ore(c_ore, 0, ore_param2);
int y_start = pr.range(nmin.Y, nmax.Y);
@@ -313,7 +313,7 @@ void OrePuff::generate(MMVManip *vm, int mapseed, u32 blockseed,
void OreBlob::generate(MMVManip *vm, int mapseed, u32 blockseed,
v3s16 nmin, v3s16 nmax, u8 *biomemap)
{
- PseudoRandom pr(blockseed + 2404);
+ PcgRandom pr(blockseed + 2404);
MapNode n_ore(c_ore, 0, ore_param2);
u32 sizex = (nmax.X - nmin.X + 1);
@@ -391,7 +391,7 @@ OreVein::~OreVein()
void OreVein::generate(MMVManip *vm, int mapseed, u32 blockseed,
v3s16 nmin, v3s16 nmax, u8 *biomemap)
{
- PseudoRandom pr(blockseed + 520);
+ PcgRandom pr(blockseed + 520);
MapNode n_ore(c_ore, 0, ore_param2);
u32 sizex = (nmax.X - nmin.X + 1);