diff --git a/DATabase/Core/Generate.cs b/DATabase/Core/Generate.cs index 151487c8..27678d5e 100644 --- a/DATabase/Core/Generate.cs +++ b/DATabase/Core/Generate.cs @@ -343,9 +343,9 @@ JOIN checksums } return String.Compare(x.Game, y.Game); } - return x.SourceID - y.SourceID; + return (_norename ? String.Compare(x.Game, y.Game) : x.SourceID - y.SourceID); } - return x.SystemID - y.SystemID; + return (_norename ? String.Compare(x.Game, y.Game) : x.SystemID - y.SystemID); }); // Now check rename within games diff --git a/DATabase/Program.cs b/DATabase/Program.cs index b0f8c4b6..0c4b6876 100644 --- a/DATabase/Program.cs +++ b/DATabase/Program.cs @@ -87,8 +87,14 @@ namespace DATabase { int sysid = -1, srcid = -1; - Int32.TryParse(system, out sysid); - Int32.TryParse(source, out srcid); + if (system != "") + { + Int32.TryParse(system, out sysid); + } + if (source != "") + { + Int32.TryParse(source, out srcid); + } Generate gen = new Generate(sysid, srcid, _connectionString, norename, old); gen.Export();