1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-06-19 16:51:41 +00: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:
biroder 2023-05-30 12:37:41 +03:00
parent 0ba5aad8af
commit ed2c5f510a

View file

@ -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();
}
}