FINALLY LOADS IN, crashes when clicking :(

This commit is contained in:
Nikita Edel 2026-03-11 18:01:00 +01:00
parent b763a92f8e
commit cc65f7ee29

View file

@ -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;