mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 03:55:18 -04:00
Core: Fix not being to /undo an /undo of an online player.
This commit is contained in:
parent
61b18dd9d9
commit
1679c25a1f
@ -44,25 +44,27 @@ namespace MCGalaxy.Drawing.Ops {
|
||||
public override void Perform(Vec3S32[] marks, Player p, Level lvl, Brush brush, Action<DrawOpBlock> 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;
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ namespace MCGalaxy.Undo {
|
||||
protected override IEnumerable<UndoFormatEntry> GetEntries(Stream s, UndoFormatArgs args) {
|
||||
List<ChunkHeader> list = new List<ChunkHeader>();
|
||||
UndoFormatEntry pos;
|
||||
bool super = args.Player == null || args.Player.ircNick != null;
|
||||
bool super = Player.IsSuper(args.Player);
|
||||
DateTime start = args.Start;
|
||||
|
||||
ReadHeaders(list, s);
|
||||
|
@ -102,7 +102,7 @@ namespace MCGalaxy.Undo {
|
||||
List<ChunkHeader> list = new List<ChunkHeader>();
|
||||
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);
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user