mirror of
https://github.com/doukutsu-rs/doukutsu-rs.git
synced 2026-08-24 13:02:49 -07:00
Fixed game crash when disabing Discord Rich Presense setting and Discord isn't running. Fixed crash o exit when Discord isn't running
This commit is contained in:
@@ -166,11 +166,24 @@ impl DiscordRPC {
|
||||
}
|
||||
|
||||
pub fn clear(&mut self) -> GameResult {
|
||||
if !self.ready {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let _ = self.client.clear_activity();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn dispose(&mut self) {
|
||||
if !self.ready {
|
||||
return;
|
||||
}
|
||||
|
||||
let can_update = self.can_update.lock();
|
||||
if can_update.is_ok() {
|
||||
*can_update.unwrap() = false;
|
||||
}
|
||||
|
||||
let _ = self.client.close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user