s integer overflow, unsafe cast

This commit is contained in:
Nikita Edel committed 2026-03-11 16:10:48 +01:00
1 parent a24f9f5a5e
commit ed13020cf3
7 files changed
+28 -23

No files matched your search

@@ -432,7 +432,8 @@ void HellRandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt)
pprandom->setSeed(level->getSeed());
__int64 xScale = pprandom->nextLong() / 2 * 2 + 1;
__int64 zScale = pprandom->nextLong() / 2 * 2 + 1;
pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed());
// 4jcraft added casts to a higher int and unsigned
pprandom->setSeed((((uint64_t)xt * (uint64_t)xScale) + ((uint64_t)zt * (uint64_t)zScale)) ^ level->getSeed());
netherBridgeFeature->postProcess(level, pprandom, xt, zt);