Skip to content

Conversation

@techmunk
Copy link

The current way that handleBigInt() works does not match how true 32bit integer overflow in CS code works when casting a large number to a 32bit integer.

This patch corrects this and removes the need for the BigInteger library.

You can see a "frustrating" example of this on XianjiTV's vod at https://www.twitch.tv/videos/921493868 around1 hour 5mins into the vod.

For reference, his Game ID was: 273414764 and the predictor said his Mine Chests were:

  • 10 - Wind Spire
  • 20 - Magnet Ring
  • 50 - Combat Boots
  • 60 - Wood Mallet
  • 80 - Dark Boots
  • 90 - Wicked Kris
  • 110 - The Slammer

What he actually got in game, and what this patch corrects the predictor to show is:

  • 10 - Wind Spire
  • 20 - Elf Blade
  • 50 - Pirate's Sword
  • 60 - Burglar's Shank
  • 80 - Dark Boots
  • 90 - Obsidian Edge
  • 110 - Steel Falchion

I think anyone with a seed that overflows a 32 bit signed integer, or in the case of mine chests, is larger than 4194303, they will "buffer overflow" and the predictor I believe will show the incorrect results for one or more mine chests.

…g. Also removes the need for the BigInteger library.
@powderdba
Copy link

I believe I've been hit by this bug because none of my geode predictions are correct, and they were on my last game save. My new game save ID is 301947353, which is higher than 4194303.

@primarycolor
Copy link

BigInteger.min.js is not required. This is my handleBigInt (num) version " return (num% 4294967296)<<0; ".
There is another hard to find error. In cs-random.js, the number returned by InternalSample() will be greater than INT_ MAX or less than INT_ MIN。

Translated from Chinese:
BigInteger.min.js并不是必须的,我的handleBigInt(num)版本return (num % 4294967296) << 0 ;
还有一个难以发现的错误在cs-random.js里,InternalSample()返回的数字会大于INT_MAX或小于INT_MIN。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants