Skip to content

Commit

Permalink
Fix (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wind2009-Louse authored Jul 26, 2024
1 parent 11169f2 commit 721a833
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Game/AI/DefaultExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ protected bool DefaultCheckWhetherCardIsNegated(ClientCard card)
if (originId == 0) originId = card.Data.Id;
return crossoutDesignatorIdList.Contains(originId)
|| (calledbytheGraveIdCountMap.ContainsKey(originId) && calledbytheGraveIdCountMap[originId] > 0)
|| card.IsDisabled();
|| (card.IsDisabled() && ((int)card.Location & (int)CardLocation.Onfield) > 0);
}

protected bool DefaultCheckWhetherCardIdIsNegated(int cardId)
Expand Down
2 changes: 1 addition & 1 deletion Game/GameAI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1162,14 +1162,14 @@ public BattlePhaseAction ToMainPhase2()

private bool ShouldExecute(CardExecutor exec, ClientCard card, ExecutorType type, int desc = -1, int timing = -1)
{
Executor.SetCard(type, card, desc, timing);
if (card.Id != 0 && type == ExecutorType.Activate)
{
if (_activatedCards.ContainsKey(card.Id) && _activatedCards[card.Id] >= 9)
return false;
if (!Executor.OnPreActivate(card))
return false;
}
Executor.SetCard(type, card, desc, timing);
bool result = card != null && exec.Type == type &&
(exec.CardId == -1 || exec.CardId == card.Id) &&
(exec.Func == null || exec.Func());
Expand Down
2 changes: 1 addition & 1 deletion Game/GameBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ private void InternalOnSelectCard(BinaryReader packet, Func<IList<ClientCard>, i
card.Controller = player;
}
if (card == null) continue;
if (card.Id == 0)
if (card.Id == 0 || card.Location == CardLocation.Deck)
card.SetId(id);
cards.Add(card);
}
Expand Down

0 comments on commit 721a833

Please sign in to comment.