Skip to content

Commit

Permalink
fix for loading old libraries.
Browse files Browse the repository at this point in the history
  • Loading branch information
cadon committed Apr 12, 2016
1 parent 4f8729a commit 98a823d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ARKBreedingStats/CreatureCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace ARKBreedingStats
[XmlArray]
public List<Creature> creatures = new List<Creature>();
[XmlArray]
public double[][] multipliers = new double[8][]; // multipliers[stat][m], m: 0:tamingadd, 1:tamingmult, 2:levelupdom, 3:levelupwild
public double[][] multipliers; // multipliers[stat][m], m: 0:tamingadd, 1:tamingmult, 2:levelupdom, 3:levelupwild
[XmlArray]
public double[] breedingMultipliers = new double[] { 1, 1 }; // multipliers[m], m: 0:EggHatchSpeedMultiplier, 1:BabyMatureSpeedMultiplier
[XmlArray]
Expand Down
10 changes: 7 additions & 3 deletions ARKBreedingStats/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ private bool loadStatFile()
int s = 0;
comboBoxCreatures.Items.Clear();
stats.Clear();
statsRaw.Clear();
foreach (string row in rows)
{
if (row.Length > 1 && row.Substring(0, 2) != "//")
Expand Down Expand Up @@ -1437,7 +1438,7 @@ private void createOwnerList()
checkedListBoxOwner.Items.Add("n/a", (creatureCollection.hiddenOwners.IndexOf("n/a") == -1));
foreach (Creature c in creatureCollection.creatures)
{
if (c.owner.Length == 0)
if (c.owner == null || c.owner.Length == 0)
removeWOOwner = false;
else if (c.owner.Length > 0 && checkedListBoxOwner.Items.IndexOf(c.owner) == -1)
{
Expand Down Expand Up @@ -1573,7 +1574,7 @@ private ListViewItem createCreatureLVItem(Creature cr, ListViewGroup g)
// user wants to check if a new version of stats.txt is available and then download it
private void checkForUpdatedStatsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Do you want to check for a new version of the stats.txt-file?\nYour current files will be backuped.\n\nIf your stats are outdated and no new version is available, we probably don't have the new ones either.", "Update stat-files?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
if (MessageBox.Show("Do you want to check for a new version of the stats.txt-file?\nYour current stat-file will be backuped.", "Update stat-files?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
try
{
Expand Down Expand Up @@ -1607,7 +1608,10 @@ private void checkForUpdatedStatsToolStripMenuItem_Click(object sender, EventArg
if (updated[0])
{
if (loadStatFile())
{
applyMultipliersToStats();
MessageBox.Show("Download of new stats update of entries successful", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
MessageBox.Show("Download of new stat successful, but files couldn't be loaded.\nTry again later, revert the backuped files (stats_backup_....txt) or redownload the tool.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Expand All @@ -1623,7 +1627,7 @@ private void checkForUpdatedStatsToolStripMenuItem_Click(object sender, EventArg
MessageBox.Show("You already have the newest version of the files.\n\nIf your stats are outdated and no new version is available, we probably don't have the new ones either.", "No new Version", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (Exception ex)
catch (System.Net.WebException ex)
{
MessageBox.Show("Error while checking for new version or downloading it:\n\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
Expand Down
2 changes: 1 addition & 1 deletion ARKBreedingStats/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.18.5.0")]
[assembly: AssemblyFileVersion("0.18.6.0")]

0 comments on commit 98a823d

Please sign in to comment.