Skip to content

Commit b896b0e

Browse files
authored
fix: only show render button if replay available (#925)
1 parent 888138e commit b896b0e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bathbot/src/commands/utility/embed_builder.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ pub struct ScoreEmbedDataHalf {
415415
pub pb_idx: Option<ScoreEmbedDataPersonalBest>,
416416
pub legacy_scores: bool,
417417
pub with_render: bool,
418+
pub has_replay: bool,
418419
pub miss_analyzer_check: MissAnalyzerCheck,
419420
pub original_idx: Option<usize>,
420421
}
@@ -450,6 +451,7 @@ impl ScoreEmbedDataHalf {
450451
None => calc.score(&score).performance().await.pp() as f32,
451452
};
452453

454+
let has_replay = score.has_replay;
453455
let score = ScoreSlim::new(score, pp);
454456

455457
Self {
@@ -462,6 +464,7 @@ impl ScoreEmbedDataHalf {
462464
pb_idx,
463465
legacy_scores,
464466
with_render,
467+
has_replay,
465468
miss_analyzer_check,
466469
original_idx: None,
467470
}
@@ -538,8 +541,8 @@ impl ScoreEmbedDataHalf {
538541

539542
let if_fc_pp = if_fc.map(|if_fc| if_fc.pp);
540543

541-
let replay_score_id =
542-
(self.with_render && !self.score.is_legacy).then_some(self.score.score_id);
544+
let replay_score_id = (self.with_render && self.has_replay && !self.score.is_legacy)
545+
.then_some(self.score.score_id);
543546

544547
ScoreEmbedData {
545548
score: self.score,

0 commit comments

Comments
 (0)