diff --git a/Commands/Moderation/CmdHighlight.cs b/Commands/Moderation/CmdHighlight.cs index ca292e5b5..eea9f7ec4 100644 --- a/Commands/Moderation/CmdHighlight.cs +++ b/Commands/Moderation/CmdHighlight.cs @@ -71,11 +71,11 @@ namespace MCGalaxy.Commands { while (node != null) { Level lvl = LevelInfo.FindExact(node.MapName); - if (lvl != p.level) continue; + if (lvl != p.level) { node = node.Prev; continue; } List items = node.Items; for (int i = items.Count - 1; i >= 0; i--) { - UndoCacheItem item = items[i]; + UndoCacheItem item = items[i]; ushort x, y, z; node.Unpack(item.Index, out x, out y, out z); DateTime time = node.BaseTime.AddSeconds(item.TimeDelta + seconds); diff --git a/Commands/building/CmdRedo.cs b/Commands/building/CmdRedo.cs index 879f57c30..b392a5ead 100644 --- a/Commands/building/CmdRedo.cs +++ b/Commands/building/CmdRedo.cs @@ -42,7 +42,7 @@ namespace MCGalaxy.Commands { while (node != null) { Level lvl = LevelInfo.FindExact(node.MapName); - if (lvl == null) continue; + if (lvl == null) { node = node.Prev; continue; } List items = node.Items; for (int i = items.Count - 1; i >= 0; i--) { diff --git a/Commands/building/CmdUndo.cs b/Commands/building/CmdUndo.cs index 61ec2a5a8..63ba70961 100644 --- a/Commands/building/CmdUndo.cs +++ b/Commands/building/CmdUndo.cs @@ -159,7 +159,7 @@ namespace MCGalaxy.Commands while (node != null) { Level lvl = LevelInfo.FindExact(node.MapName); - if (lvl == null) continue; + if (lvl == null) { node = node.Prev; continue; } saveLvl = lvl; List items = node.Items; diff --git a/Player/Player.cs b/Player/Player.cs index 7290ef6c4..62cff7aaa 100644 --- a/Player/Player.cs +++ b/Player/Player.cs @@ -402,7 +402,7 @@ namespace MCGalaxy { Server.ErrorLog(e); } try { - SaveUndo(); + SaveUndo(this); } catch (Exception e) { Server.s.Log("Error saving undo data."); Server.ErrorLog(e); @@ -559,7 +559,7 @@ namespace MCGalaxy { if (name == "") { if (socket != null) CloseSocket(); connections.Remove(this); - SaveUndo(); + SaveUndo(this); disconnected = true; return; } @@ -637,8 +637,6 @@ namespace MCGalaxy { } } - public void SaveUndo() { SaveUndo(this); } - public static void SaveUndo(Player p) { try { UndoFile.SaveUndo(p); diff --git a/Player/Undo/UndoFile.cs b/Player/Undo/UndoFile.cs index b69b580a8..d926dfc7f 100644 --- a/Player/Undo/UndoFile.cs +++ b/Player/Undo/UndoFile.cs @@ -41,7 +41,7 @@ namespace MCGalaxy.Util { protected abstract string Extension { get; } public static void SaveUndo(Player p) { - if( p == null || p.UndoBuffer.Count < 1) return; + if (p == null || p.UndoBuffer.Count < 1) return; CreateDefaultDirectories(); if (Directory.GetDirectories(undoDir).Length >= Server.totalUndo) {