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 ...@@ -82,7 +82,6 @@ namespace WindBot.Game
if (Data != null) if (Data != null)
{ {
Name = Data.Name; Name = Data.Name;
if (Data.Alias != 0)
Alias = Data.Alias; Alias = Data.Alias;
} else { } else {
Name = null; Name = null;
......
...@@ -1090,7 +1090,7 @@ namespace WindBot.Game ...@@ -1090,7 +1090,7 @@ namespace WindBot.Game
else else
card = _duel.GetCard(player, loc, seq); card = _duel.GetCard(player, loc, seq);
if (card == null) continue; if (card == null) continue;
if (card.Id == 0) if (card.Id == 0 || card.Location == CardLocation.Deck)
card.SetId(id); card.SetId(id);
cards.Add(card); cards.Add(card);
} }
...@@ -1102,6 +1102,14 @@ namespace WindBot.Game ...@@ -1102,6 +1102,14 @@ namespace WindBot.Game
CardLocation loc = (CardLocation)packet.ReadByte(); CardLocation loc = (CardLocation)packet.ReadByte();
int seq = packet.ReadByte(); int seq = packet.ReadByte();
packet.ReadByte(); // pos 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; 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