fix: don't calculate in task

This commit is contained in:
Anna 2021-01-29 15:02:19 -05:00
parent 2bedf0e9bb
commit e0ba98853f
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0

View File

@ -69,13 +69,7 @@ namespace NoSoliciting {
}
// pre-compute the max ilvl to prevent stutter
Task.Run(async () => {
while (!this.Interface.Data.IsDataReady) {
await Task.Delay(1_000).ConfigureAwait(true);
}
FilterUtil.MaxItemLevelAttainable(this.Interface.Data);
});
FilterUtil.MaxItemLevelAttainable(this.Interface.Data);
this.Interface.Framework.Gui.Chat.OnCheckMessageHandled += this.Filter.OnChat;
this.Interface.UiBuilder.OnBuildUi += this.Ui.Draw;
@ -90,7 +84,7 @@ namespace NoSoliciting {
return;
}
Task.Run(async () => { this.MlFilter = await MlFilter.Load(this); })
Task.Run(async () => this.MlFilter = await MlFilter.Load(this))
.ContinueWith(e => {
if (!e.IsFaulted) {
PluginLog.Log("Machine learning model loaded");