Fixed generation changes in recent builds compared to 3.x

this was caused by improper RNG sanitization and a recent cleanup refactor.
This commit is contained in:
Dylan K. Taylor 2018-12-27 17:36:41 -05:00
parent cf20f0e23a
commit ab75e89d95

View File

@ -77,6 +77,11 @@ class Simplex extends Noise{
$this->perm[$pos] = $old; $this->perm[$pos] = $old;
$this->perm[$i + 256] = $this->perm[$i]; $this->perm[$i + 256] = $this->perm[$i];
} }
//this dummy call is necessary to produce the same RNG state as before latest refactors to this file
//previously this value would be used for offsetW
//TODO: this really needs to reset the RNG seed to avoid future RNG contamination
$random->nextSignedInt();
} }
public function getNoise3D($x, $y, $z){ public function getNoise3D($x, $y, $z){