Commit 646301e
committed
Fix rare crash in RandomSpriteProvider
This was caused by RandomIndexProvider.Unweighted using Math.abs, meaning it could return a negative value if the passed seed was equal to Integer.MIN_VALUE. This commit replaces Math.abs with a function that sets the sign bit to 0.
Fix #6161 parent 80f742e commit 646301e
File tree
2 files changed
+6
-2
lines changed- src/main/java/me/pepperbell/continuity/client/util
2 files changed
+6
-2
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
0 commit comments