andrecronje / rarity

d20srd reference implementation codified in solidity
Other
610 stars 121 forks source link

[Rarity] Random function does not match dice values #76

Open MrTancred opened 3 years ago

MrTancred commented 3 years ago

The random function 0x7426dBE5207C2b5DaC57d8e55F0959fcD99661D4 result is offset by one, so it does not match dice values. For example, d6 produces 0,1,2,3,4,5 rather than 1,2,3,4,5,6

At the moment this is affecting the Crafting check, since the d20 result is 0-19 rather than 1-20 as it should be per SRD.