mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-06-05 23:03:07 +00:00
FINALLY LOADS IN, crashes when clicking :(
This commit is contained in:
parent
b763a92f8e
commit
cc65f7ee29
|
|
@ -3582,9 +3582,10 @@ bool TileRenderer::tesselateCrossInWorld( Tile* tt, int x, int y, int z )
|
|||
|
||||
if (tt == Tile::tallgrass)
|
||||
{
|
||||
__int64 seed = (x * 3129871) ^ (z * 116129781l) ^ (y);
|
||||
seed = seed * seed * 42317861 + seed * 11;
|
||||
|
||||
// 4jcraft add a bunch of casts to prevent overflow (i pray to god)
|
||||
int64_t seed = ((int64_t)x * 3129871) ^ ((int64_t)z * 116129781L) ^ ((int64_t)y);
|
||||
seed = (int64_t)(((uint64_t)seed * (uint64_t)seed * 42317861ULL) + ((uint64_t)seed * 11ULL));
|
||||
|
||||
xt += ((((seed >> 16) & 0xf) / 15.0f) - 0.5f) * 0.5f;
|
||||
yt += ((((seed >> 20) & 0xf) / 15.0f) - 1.0f) * 0.2f;
|
||||
zt += ((((seed >> 24) & 0xf) / 15.0f) - 0.5f) * 0.5f;
|
||||
|
|
|
|||
Loading…
Reference in a new issue