Fix random level order of operations

yay ints not floats

[ (100+%)*current ] / 100 = lvl
old code would [0/1/2]*current = lvl, due to int behavior
This commit is contained in:
Kaphotics
2016-09-18 10:12:36 -07:00
parent ac345c6de2
commit ebac2e5d05

View File

@@ -720,7 +720,7 @@ private void Randomize()
trpk_form[p].SelectedIndex = (int)(rnd32() % trpk_form[p].Items.Count);
}
if (rLevel)
trpk_lvl[p].SelectedIndex = Math.Max(1, Math.Min((int)(trpk_lvl[p].SelectedIndex * ((100 + rLevelPercent) / 100)), 100));
trpk_lvl[p].SelectedIndex = Math.Max(1, Math.Min((int)(trpk_lvl[p].SelectedIndex * (100 + rLevelPercent) / 100), 100));
if (rAbility)
trpk_abil[p].SelectedIndex = (int)(1 + rnd32() % 3);
if (rDiffIV)