Skip to content

Commit

Permalink
* fix for an out-of-range-case
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Nov 27, 2015
1 parent 98f0af4 commit 450b336
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions ARKBreedingStats/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ private void clearAll()
this.checkBoxAlreadyBred.BackColor = System.Drawing.Color.Transparent;
this.checkBoxJustTamed.BackColor = System.Drawing.Color.Transparent;
buttonCopyClipboard.Enabled = false;
labelTE.Text = "Extracted: n/a";
activeStat = -1;
}

Expand Down Expand Up @@ -226,6 +227,7 @@ private void buttonCalculate_Click(object sender, EventArgs e)
statIOs[s].Status = -2;
statIOs[7].Status = -2;
results[s].Clear();
resultsValid = false;
break;
}
}
Expand Down Expand Up @@ -331,7 +333,6 @@ private void buttonCalculate_Click(object sender, EventArgs e)
{
buttonCopyClipboard.Enabled = true;
setActiveStat(activeStatKeeper);

setUniqueTE();
}
if (!postTamed)
Expand Down Expand Up @@ -566,13 +567,13 @@ private void buttonCopyClipboard_Click(object sender, EventArgs e)

private double uniqueTE()
{
if (statWithEff.Count > 0)
if (statWithEff.Count > 0 && results[statWithEff[0]].Count > chosenResults[statWithEff[0]])
{
double eff = results[statWithEff[0]][chosenResults[statWithEff[0]]][2];
for (int st = 1; st < statWithEff.Count; st++)
{
// efficiency-calculation can be a bit off due to ingame-rounding
if (Math.Abs(results[statWithEff[st]][chosenResults[statWithEff[st]]][2] - eff) > 0.002)
if (results[statWithEff[st]].Count <= chosenResults[statWithEff[st]] || Math.Abs(results[statWithEff[st]][chosenResults[statWithEff[st]]][2] - eff) > 0.002)
{
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="labelDoc.Text" xml:space="preserve">
<value>If the levels cannot be determined uniquely, the stat-box on the left becomes dark-grey. Click on it to choose a possibility from the list on the right. For example if you know that you never leveled up oxygen, you can choose the entry with the 0 in the Domesticated-column.
<value>If the levels cannot be determined uniquely, the stat-box on the left becomes yellow. Click on it to choose a possibility from the list on the right. For example if you know that you never leveled up oxygen, you can choose the entry with the 0 in the Domesticated-column.
The exacter / narrower the "Taming Efficiency Range", the fewer possible results.
The TEfficency can differ 0.1% due to ingame-rounding.</value>
</data>
Expand Down

0 comments on commit 450b336

Please sign in to comment.