diff --git a/Character.cs b/Character.cs index 9f0ac14..bb8a242 100644 --- a/Character.cs +++ b/Character.cs @@ -787,34 +787,6 @@ public static Character LoadFromFile(BinaryReader stream) newChar.Tokens.Add(Token.LoadFromFile(stream)); newChar.UpdateTitle(); - //Fix the results of a bug that caused multiple a, ispropernamed, and culture tokens to appear, namely the above-commented. - //TODO: bump world version, remove that shit. - var a = false; - var p = false; - var c = false; - foreach (var token in newChar.Tokens) - { - if (token.Name == "a") - { - if (a) - token.Name = "__kill"; - a = true; - } - else if (token.Name == "ispropernamed") - { - if (p) - token.Name = "__kill"; - p = true; - } - else if (token.Name == "culture") - { - if (c) - token.Name = "__kill"; - c = true; - } - } - newChar.Tokens.RemoveAll(t => t.Name == "__kill"); - return newChar; } diff --git a/Game.cs b/Game.cs index 429ee88..edc2aac 100644 --- a/Game.cs +++ b/Game.cs @@ -561,7 +561,7 @@ public void SaveGame(bool noPlayer = false, bool force = false, bool clear = tru CurrentBoard.SaveToFile(CurrentBoard.BoardNum); var verCheck = Path.Combine(SavePath, WorldName, "version"); - File.WriteAllText(verCheck, "20"); + File.WriteAllText(verCheck, "21"); Program.WriteLine("Done."); Program.WriteLine("--------------------------"); } @@ -572,7 +572,7 @@ public void LoadGame() if (!File.Exists(verCheck)) throw new Exception("Tried to open an old worldsave."); WorldVersion = int.Parse(File.ReadAllText(verCheck)); - if (WorldVersion < 20) + if (WorldVersion < 21) throw new Exception("Tried to open an old worldsave."); HostForm.Clear(); @@ -604,25 +604,6 @@ public void LoadGame() var currentIndex = bin.ReadInt32(); var boardCount = bin.ReadInt32(); - //TODO: remove entirely after bumping version # - var poti = bin.ReadChars(4); - if (new string(poti) == "POTI") - { - Program.WriteLine("Ignoring POTI data..."); - for (var i = 0; i < 256; i++) - bin.ReadString(); - } - else - { - bin.BaseStream.Seek(-4, SeekOrigin.Current); - } - /* - Toolkit.ExpectFromFile(bin, "POTI", "potion and ring"); - Potions = new string[256]; - for (var i = 0; i < 256; i++) - Potions[i] = bin.ReadString(); - */ - Toolkit.ExpectFromFile(bin, "ITID", "item identification"); var numIDs = bin.ReadInt32(); Identifications.Clear();