Skip to content

Commit

Permalink
Quickfix for a really rare case when the combat simulation is done an…
Browse files Browse the repository at this point in the history
…d the node that was added to the tree is exactly the end node.
  • Loading branch information
Shirkit committed Mar 13, 2014
1 parent b650980 commit ff8383a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Assets/Editor/MapperWindowEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,12 @@ void OnGUI () {
foreach (List<Node> deathNodes in combat.deathPaths) {
deaths.Add(new Path(deathNodes));
}
} catch (IndexOutOfRangeException e) {
} catch (Exception e) {
Debug.LogWarning("Skip errored calculated path");
// This can happen in two different cases:
// In line 376 by having a duplicate node being picked (coincidence picking the EndNode as visiting but the check is later on)
// We also cant just bring the check earlier since there's data to be copied (really really rare cases)
// The other case is yet unkown, but it's a conicidence by trying to insert a node in the tree that already exists (really rare cases)
}
}
// Set the map to be drawn
Expand Down

0 comments on commit ff8383a

Please sign in to comment.