Skip to content

Commit

Permalink
fix(BobsBuddyInvoker): actually start writing to _opponentSecretMap
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed Dec 4, 2023
1 parent 2414729 commit 3093e1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Hearthstone Deck Tracker/BobsBuddy/BobsBuddyInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal class BobsBuddyInvoker
public int LastAttackingHeroAttack;
private static List<string> _recentHDTLog = new List<string>();
private static List<Entity> _currentOpponentSecrets = new List<Entity>();
private static Dictionary<Entity, Entity> _opponentSecretMap = new ();
private static Dictionary<Entity, Entity> _opponentSecretMap = new();

private List<Entity> _opponentHand = new();
private readonly Dictionary<Entity, Entity> _opponentHandMap = new();
Expand Down Expand Up @@ -544,6 +544,10 @@ internal async void UpdateOpponentHand(Entity entity, Entity copy)

internal async void UpdateSecret(Entity entity)
{
var oldSecret = _currentOpponentSecrets.Find(x => x.Id == entity.Id);
if(oldSecret != null)
_opponentSecretMap[oldSecret] = entity;

_currentOpponentSecrets = _currentOpponentSecrets.Select(x => {
if(_opponentSecretMap.TryGetValue(x, out var retval))
{
Expand Down

0 comments on commit 3093e1d

Please sign in to comment.