Skip to content

Commit

Permalink
final fix for fixed not fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Denadan committed Jan 22, 2019
1 parent 51a18a7 commit a849beb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
7 changes: 7 additions & 0 deletions source/CCLight/Database.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ private bool SetCustomInternal(string key, ICustom cc, bool replace)
Control.Logger.LogDebug($"--replace: from:{custom} to:{cc}");
#endif
if (replace)
{
ccs[i] = cc;
return true;
}

return false;
}
}
Expand All @@ -128,7 +132,10 @@ private bool SetCustomInternal(string key, ICustom cc, bool replace)
Control.Logger.LogDebug($"--replace: from:{custom} to:{cc}");
#endif
if (replace)
{
ccs[i] = cc;
return true;
}
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static void Init(string directory, string settingsJSON)
Registry.RegisterSimpleCustomComponents(Assembly.GetExecutingAssembly());
Validator.RegisterMechValidator(CategoryController.ValidateMech, CategoryController.ValidateMechCanBeFielded);

Logger.Log("Loaded CustomComponents v0.9.0.2 for bt 1.3.2");
Logger.Log("Loaded CustomComponents v0.9.0.3 for bt 1.3.2");
#if CCDEBUG
Logger.LogDebug("Loading Categories");
#endif
Expand Down
16 changes: 16 additions & 0 deletions source/Helpers/DefaultHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ public static void AddInventory(string defaultID, MechDef mech, ChassisLocations
var inv = mech.Inventory.ToList();
inv.Add(r);
mech.SetInventory(inv.ToArray());
#if CCDEBUG
var flag = r.GetComponent<Flags>();
Control.Logger.LogDebug($"AddInventory: {r.Def.Description.Id} isdefult:{r.Def.IsDefault()} isfixed:{r.IsFixed} isFlag:{flag == null}");
if (flag == null)
{
Control.Logger.LogDebug($"-- NO FLAGS!");
}
else
{
Control.Logger.LogDebug($"-- default: {flag.IsSet("default")} isdefault:{flag.Default}");
}
foreach (var simpleCustomComponent in r.GetComponents<SimpleCustomComponent>())
{
Control.Logger.LogDebug($"-- {simpleCustomComponent}");
}
#endif
}
}

Expand Down

0 comments on commit a849beb

Please sign in to comment.