mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +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
|
@ -87,7 +87,7 @@ void Decoration::resolveNodeNames()
|
|||
|
||||
size_t Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
|
||||
{
|
||||
PseudoRandom ps(blockseed + 53);
|
||||
PcgRandom ps(blockseed + 53);
|
||||
int carea_size = nmax.X - nmin.X + 1;
|
||||
|
||||
// Divide area into parts
|
||||
|
@ -170,7 +170,7 @@ size_t Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
|
|||
#if 0
|
||||
void Decoration::placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
|
||||
{
|
||||
PseudoRandom pr(blockseed + 53);
|
||||
PcgRandom pr(blockseed + 53);
|
||||
std::vector<CutoffData> handled_cutoffs;
|
||||
|
||||
// Copy over the cutoffs we're interested in so we don't needlessly hold a lock
|
||||
|
@ -286,7 +286,7 @@ bool DecoSimple::canPlaceDecoration(MMVManip *vm, v3s16 p)
|
|||
}
|
||||
|
||||
|
||||
size_t DecoSimple::generate(MMVManip *vm, PseudoRandom *pr, v3s16 p)
|
||||
size_t DecoSimple::generate(MMVManip *vm, PcgRandom *pr, v3s16 p)
|
||||
{
|
||||
if (!canPlaceDecoration(vm, p))
|
||||
return 0;
|
||||
|
@ -327,7 +327,7 @@ DecoSchematic::DecoSchematic()
|
|||
}
|
||||
|
||||
|
||||
size_t DecoSchematic::generate(MMVManip *vm, PseudoRandom *pr, v3s16 p)
|
||||
size_t DecoSchematic::generate(MMVManip *vm, PcgRandom *pr, v3s16 p)
|
||||
{
|
||||
// Schematic could have been unloaded but not the decoration
|
||||
// In this case generate() does nothing (but doesn't *fail*)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue