Changeset - 339712c9aa0a
[Not reviewed]
default
0 1 0
Jason Maltzen (jmaltzen) - 9 years ago 2015-12-26 04:08:57
jason.maltzen@unsanctioned.net
Fix up a crash that can happen one resume if ingredients are disabled between recipe generation runs.
1 file changed with 14 insertions and 11 deletions:
0 comments (0 inline, 0 general)
RecipeGenerator.cs
Show inline comments
...
 
@@ -248,3 +248,3 @@ namespace DesertPaintLab
 
                    bool inUse = reagentInUse[idx];
 
                    if (inUse == false)
 
                    if ((inUse == false) && (costSortedReagents[(int)idx].Enabled))
 
                    {
...
 
@@ -386,3 +386,6 @@ namespace DesertPaintLab
 
                                        {
 
                                            reagentInUse[reagentId] = true;
 
                                            if (reagentId != INVALID_REAGENT)
 
                                            {
 
                                                reagentInUse[reagentId] = true;
 
                                            }
 
                                        }
...
 
@@ -542,6 +545,3 @@ namespace DesertPaintLab
 
                Reagent reagent = ReagentManager.GetReagent(name);
 
                if (reagent.Enabled)
 
                {
 
                    costSortedReagents.Add(reagent);
 
                }
 
                costSortedReagents.Add(reagent);
 
            }
...
 
@@ -576,3 +576,3 @@ namespace DesertPaintLab
 
            {
 
                if (!reagent.IsCatalyst && reagent.RecipeMax >= 10)
 
                if (!reagent.IsCatalyst && reagent.RecipeMax >= 10 && reagent.Enabled)
 
                {
...
 
@@ -591,6 +591,9 @@ namespace DesertPaintLab
 
            {
 
                SearchNode initialNode = new SearchNode(costSortedReagents, reagentIdx);
 
                initialNode.MaxQuantity = maxQuantity;
 
                initialNode.MaxReagents = maxReagents;
 
                searchQueue.Enqueue(initialNode);
 
                if (costSortedReagents[(int)reagentIdx].Enabled)
 
                {
 
                    SearchNode initialNode = new SearchNode(costSortedReagents, reagentIdx);
 
                    initialNode.MaxQuantity = maxQuantity;
 
                    initialNode.MaxReagents = maxReagents;
 
                    searchQueue.Enqueue(initialNode);
 
                }
 
            }
0 comments (0 inline, 0 general)