Skip to content

Commit

Permalink
feat: pass reroll flag to hero picking API
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed Dec 11, 2024
1 parent 3a5252b commit 6df148a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 2 additions & 6 deletions Hearthstone Deck Tracker/GameEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ private async void HandleBattlegroundsStart()
}

_game.SnapshotBattlegroundsOfferedHeroes(heroes);
_game.CacheBattlegroundsHeroPickParams();
_game.CacheBattlegroundsHeroPickParams(false);

var heroIds = heroes.OrderBy(x => x.ZonePosition).Select(x => x.Card.DbfId).ToArray();
if(Config.Instance.HideOverlay)
Expand Down Expand Up @@ -1626,11 +1626,7 @@ private async Task RefreshBattlegroundsHeroPickStats()

// refresh the offered heroes
_game.SnapshotBattlegroundsOfferedHeroes(heroes);
_game.CacheBattlegroundsHeroPickParams();

var parameters = _game.GetBattlegroundsHeroPickParams();
if(parameters == null)
return;
_game.CacheBattlegroundsHeroPickParams(true);

try
{
Expand Down
3 changes: 2 additions & 1 deletion Hearthstone Deck Tracker/Hearthstone/GameV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ public void CacheMulliganGuideParams()

private BattlegroundsHeroPickStatsParams? _battlegroundsHeroPickStatsParams;

public void CacheBattlegroundsHeroPickParams()
public void CacheBattlegroundsHeroPickParams(bool isReroll)
{
if(_battlegroundsHeroPickStatsParams != null)
{
Expand All @@ -590,6 +590,7 @@ public void CacheBattlegroundsHeroPickParams()
AnomalyDbfId = BattlegroundsUtils.GetBattlegroundsAnomalyDbfId(Core.Game.GameEntity),
LanguageCode = Helper.GetCardLanguage(),
BattlegroundsRating = Core.Game.CurrentBattlegroundsRating,
IsReroll = isReroll,
};
return;
}
Expand Down

0 comments on commit 6df148a

Please sign in to comment.