Suzuki Stumpy Posted February 25, 2023 Clone Share Posted February 25, 2023 Eric, one for you I suspect. We've come across a bug in the TOR system function for the die roller. When rolling favoured skills, the roller rolls 2d12 as the Feat dice and is supposed to take the highest result. However, under the TOR system, 11 is the Eye of Sauron and is the worst roll that can be made [i.e. counts as zero] and 12 is the Gandalf rune [the best roll that can be made]. We've just had a favoured roll that's selected the eye as the highest roll of the 2d12 as shown below: The actual result should have been: [5] (0, 4) since in this case, the five is a better roll than the Eye. Here's a linky to the actual post so you can see: https://test.myth-weavers.com/index.php?/topic/683-year-2950-those-who-tarry-no-longer/&do=findComment&comment=34895 Link to comment Share on other sites More sharing options...
Eric Posted February 25, 2023 Clone Share Posted February 25, 2023 Yup, I have found the bug and am fixing it now. Link to comment Share on other sites More sharing options...
Eric Posted February 25, 2023 Clone Share Posted February 25, 2023 Old code: if (d.rolls[0] > d.rolls[1] && d.rolls[0] != 11) roll = d.rolls[0]; else roll = d.rolls[1]; New code: if (d.rolls[0] == 11) // Eye, use the other one (hopefully not also an eye!) roll = d.rolls[1]; else if (d.rolls[1] == 11) // Eye, use the other one (hopefully not also an eye!) roll = d.rolls[0]; else if (d.rolls[0] >= d.rolls[1]) roll = d.rolls[0]; else roll = d.rolls[1]; As you can probably see, the old code has a weakness if the second roll (d.rolls[1]) is 11 and the first roll is anything less. The new code is (very slightly) less efficient but also very explicit to avoid 11s if at all possible 😄 Link to comment Share on other sites More sharing options...
Suzuki Stumpy Posted February 25, 2023 Author Clone Share Posted February 25, 2023 Yep, that'll do it. Thanks Eric. Link to comment Share on other sites More sharing options...
Recommended Posts