For those who don't understand code. I have no idea what the context is, but basically, this code handles charged shots, I presume activated in a batch that sets off all available shots. The code gathers a list of all available marbles, then one by one fires them based on how much they have managed to charge up shots. The problem is, in C#, there is no handler for integer overflows as there is in a language like Python. So here he has called the value, that is presumably stored as an undetermined type value (ie a var) and executed it as a 32bit integer, which has a max value of 2.1 billion or so. Doing this would make the value fire as infinite, which would not properly apply math values and probably just throw an error on his background debug console. Either that or it would only read the first 32 bits of data, which most likely are basically 0, although I'm pretty sure C# shouldn't do this. Basically, the bug is the (int) in the at the end. Theres multiple solutions ofc for this, the easiest being just calling the number as a long, which is a 64 bit integer, which has a max value of 9,223,372,036,854,775,807, and I imagine if 9 billion was higher than expected, the long should be virtually impossible to reach.
10 months ago (edited)
| 25
Uh… this is the first time you shared a behind the scenes (code revealed)… so funny…
10 months ago | 30
Cyan would've won that game, but the bug said NO and just poofed that hard-worked 9B. Shame.
10 months ago | 9
Cool I wasn’t sure how you were making it and was assuming you were using a physics engine wut variables but no your coding it all…Nice
9 months ago | 1
Well don't fix it, or the rest of the script will stop working entirely.
10 months ago
| 8
Why not iterate directly over marbles without creating a new list though
10 months ago | 3
Uh, is it the int typing? So the max is INTMAX or like 2 billion or so?
10 months ago | 5
Lost Marbles
Found the bug preventing the 9b shot... whoops
10 months ago | [YT] | 212