mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Convert usages of PseudoRandom to PcgRandom for ore and deco placement
In addition to being a better random, this fixes #3228
This commit is contained in:
parent
c3e179f256
commit
f3ac2517ea
3 changed files with 13 additions and 13 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue