Commit 11169f23 authored by wind2009's avatar wind2009 Committed by GitHub

Fix bot's behavior in SelectUnSelect (#198)

parent 65954e36
......@@ -82,7 +82,6 @@ namespace WindBot.Game
if (Data != null)
{
Name = Data.Name;
if (Data.Alias != 0)
Alias = Data.Alias;
} else {
Name = null;
......
......@@ -1090,7 +1090,7 @@ namespace WindBot.Game
else
card = _duel.GetCard(player, loc, seq);
if (card == null) continue;
if (card.Id == 0)
if (card.Id == 0 || card.Location == CardLocation.Deck)
card.SetId(id);
cards.Add(card);
}
......@@ -1102,6 +1102,14 @@ namespace WindBot.Game
CardLocation loc = (CardLocation)packet.ReadByte();
int seq = packet.ReadByte();
packet.ReadByte(); // pos
ClientCard card;
if (((int)loc & (int)CardLocation.Overlay) != 0)
card = new ClientCard(id, CardLocation.Overlay, -1);
else
card = _duel.GetCard(player, loc, seq);
if (card == null) continue;
if (card.Id == 0 || card.Location == CardLocation.Deck)
card.SetId(id);
}
if (count2 == 0) cancelable = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment