void UndoDraw( Player player, Command command ) {
if( !player.Can( Permissions.Draw ) ) {
world.NoAccessMessage( player );
return;
}
if( player.drawUndoBuffer.Count > 0 ) {
if( player.drawingInProgress ) {
player.Message( "Cannot undo a drawing-in-progress. Wait for it to finish." );
} else {
world.SendToAll( Color.Sys + player.name + " initiated /drawundo. " + player.drawUndoBuffer.Count + " blocks to replace...", null );
while( player.drawUndoBuffer.Count > 0 ) {
world.map.QueueUpdate( player.drawUndoBuffer.Dequeue() );
}
}
GC.Collect();
} else {
player.Message( "There is currently nothing to undo." );
}
}