Skip to content

Commit

Permalink
Ignore the cache (and force a PartDatabase.cfg generation) on KSP ver…
Browse files Browse the repository at this point in the history
…sion change
  • Loading branch information
sarbian committed Jun 25, 2015
1 parent b808509 commit c0a37d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion moduleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -878,12 +878,14 @@ private void IsCacheUpToDate()
if (File.Exists(shaPath))
{
ConfigNode shaConfigNode = ConfigNode.Load(shaPath);
if (shaConfigNode != null && shaConfigNode.HasValue("SHA") && shaConfigNode.HasValue("version"))
if (shaConfigNode != null && shaConfigNode.HasValue("SHA") && shaConfigNode.HasValue("version") && shaConfigNode.HasValue("KSPVersion"))
{
string storedSHA = shaConfigNode.GetValue("SHA");
string version = shaConfigNode.GetValue("version");
string kspVersion = shaConfigNode.GetValue("KSPVersion");
useCache = storedSHA.Equals(configSha);
useCache = useCache && version.Equals(Assembly.GetExecutingAssembly().GetName().Version.ToString());
useCache = useCache && kspVersion.Equals(Versioning.version_major + "." + Versioning.version_minor + "." + Versioning.Revision + "." + Versioning.BuildID);
useCache = useCache && File.Exists(cachePath);
useCache = useCache && File.Exists(physicsPath);
useCache = useCache && File.Exists(techTreePath);
Expand All @@ -898,6 +900,7 @@ private void CreateCache()
ConfigNode shaConfigNode = new ConfigNode();
shaConfigNode.AddValue("SHA", configSha);
shaConfigNode.AddValue("version", Assembly.GetExecutingAssembly().GetName().Version.ToString());
shaConfigNode.AddValue("KSPVersion", Versioning.version_major + "." + Versioning.version_minor + "." + Versioning.Revision + "." + Versioning.BuildID);
shaConfigNode.Save(shaPath);

ConfigNode cache = new ConfigNode();
Expand Down

0 comments on commit c0a37d5

Please sign in to comment.