diff --git a/Drawing/DrawOps/UndoDrawOp.cs b/Drawing/DrawOps/UndoDrawOp.cs index 6a2eee633..92dc29a9b 100644 --- a/Drawing/DrawOps/UndoDrawOp.cs +++ b/Drawing/DrawOps/UndoDrawOp.cs @@ -44,25 +44,27 @@ namespace MCGalaxy.Drawing.Ops { public override void Perform(Vec3S32[] marks, Player p, Level lvl, Brush brush, Action output) { UndoCache cache = who.UndoBuffer; using (IDisposable locker = cache.ClearLock.AccquireReadLock()) { - if (UndoBlocks(who)) return; + if (UndoBlocks(p, who)) return; } bool found = false; string target = who.name.ToLower(); - if (Min.X != ushort.MaxValue) + if (Min.X != ushort.MaxValue) { UndoFormat.DoUndoArea(p, target, Start, Min, Max, ref found); - else + } else { UndoFormat.DoUndo(p, target, Start, End, ref found); + } } - bool UndoBlocks(Player p) { + bool UndoBlocks(Player p, Player who) { UndoFormatArgs args = new UndoFormatArgs(p, Start); - UndoFormat format = new UndoFormatOnline(p.UndoBuffer); + UndoFormat format = new UndoFormatOnline(who.UndoBuffer); - if (Min.X != ushort.MaxValue) + if (Min.X != ushort.MaxValue) { UndoFormat.DoUndoArea(null, Min, Max, format, args); - else + } else { UndoFormat.DoUndo(null, End, format, args); + } return args.Stop; } } diff --git a/Player/Undo/UndoFormatBin.cs b/Player/Undo/UndoFormatBin.cs index 370918c2b..d38771741 100644 --- a/Player/Undo/UndoFormatBin.cs +++ b/Player/Undo/UndoFormatBin.cs @@ -38,7 +38,7 @@ namespace MCGalaxy.Undo { protected override IEnumerable GetEntries(Stream s, UndoFormatArgs args) { List list = new List(); UndoFormatEntry pos; - bool super = args.Player == null || args.Player.ircNick != null; + bool super = Player.IsSuper(args.Player); DateTime start = args.Start; ReadHeaders(list, s); diff --git a/Player/Undo/UndoFormatCBin.cs b/Player/Undo/UndoFormatCBin.cs index a540a4d9f..58e3379f1 100644 --- a/Player/Undo/UndoFormatCBin.cs +++ b/Player/Undo/UndoFormatCBin.cs @@ -102,7 +102,7 @@ namespace MCGalaxy.Undo { List list = new List(); UndoFormatEntry pos; UndoCacheItem item = default(UndoCacheItem); - bool super = args.Player == null || args.Player.ircNick != null; + bool super = Player.IsSuper(args.Player); DateTime start = args.Start; ReadHeaders(list, s); diff --git a/Player/Undo/UndoFormatOnline.cs b/Player/Undo/UndoFormatOnline.cs index 548d85f12..13b245558 100644 --- a/Player/Undo/UndoFormatOnline.cs +++ b/Player/Undo/UndoFormatOnline.cs @@ -42,7 +42,7 @@ namespace MCGalaxy.Undo { if (node == null) yield break; UndoFormatEntry pos; - bool super = args.Player == null || args.Player.ircNick != null; + bool super = Player.IsSuper(args.Player); DateTime start = args.Start; while (node != null) {