Commit 78589240 authored by mercury233's avatar mercury233

wtf fix

parent 9b77ddb9
...@@ -3384,11 +3384,11 @@ public class Ocgcore : ServantWithCardDescription ...@@ -3384,11 +3384,11 @@ public class Ocgcore : ServantWithCardDescription
} }
destroy(waitObject, 0, false, true); destroy(waitObject, 0, false, true);
player = localPlayer(r.ReadByte()); player = localPlayer(r.ReadByte());
bool finish = (r.ReadByte() != 0); bool finishable = (r.ReadByte() != 0);
cancalable = (r.ReadByte() != 0); cancalable = (r.ReadByte() != 0) || finishable;
ES_min = r.ReadByte(); ES_min = r.ReadByte();
ES_max = r.ReadByte(); ES_max = r.ReadByte();
ES_min = finish ? 0 : 1; // SelectUnselectCard can actually always select 1 card ES_min = finishable ? 0 : 1; // SelectUnselectCard can actually always select 1 card
ES_max = 1; // SelectUnselectCard can actually always select 1 card ES_max = 1; // SelectUnselectCard can actually always select 1 card
ES_level = 0; ES_level = 0;
count = r.ReadByte(); count = r.ReadByte();
...@@ -3421,14 +3421,10 @@ public class Ocgcore : ServantWithCardDescription ...@@ -3421,14 +3421,10 @@ public class Ocgcore : ServantWithCardDescription
allCardsInSelectMessage.Add(card); allCardsInSelectMessage.Add(card);
}*/ }*/
} }
if (cancalable) if (cancalable && !finishable)
{ {
gameInfo.addHashedButton("cancleSelected", -1, superButtonType.no, InterString.Get("取消选择@ui")); gameInfo.addHashedButton("cancleSelected", -1, superButtonType.no, InterString.Get("取消选择@ui"));
} }
else if (finish)
{
gameInfo.addHashedButton("cancleSelected", -1, superButtonType.no, "完成选择");
}
realizeCardsForSelect(); realizeCardsForSelect();
if (ES_selectHint != "") if (ES_selectHint != "")
{ {
...@@ -6203,6 +6199,12 @@ public class Ocgcore : ServantWithCardDescription ...@@ -6203,6 +6199,12 @@ public class Ocgcore : ServantWithCardDescription
case GameMessage.SelectTribute: case GameMessage.SelectTribute:
case GameMessage.SelectSum: case GameMessage.SelectSum:
m = new BinaryMaster(); m = new BinaryMaster();
if (currentMessage == GameMessage.SelectUnselectCard && cardsSelected.Count == 0)
{
m.writer.Write((Int32)(-1));
sendReturn(m.get());
break;
}
m.writer.Write((byte)(cardsMustBeSelected.Count + cardsSelected.Count)); m.writer.Write((byte)(cardsMustBeSelected.Count + cardsSelected.Count));
for (int i = 0; i < cardsMustBeSelected.Count; i++) for (int i = 0; i < cardsMustBeSelected.Count; i++)
{ {
...@@ -6216,7 +6218,6 @@ public class Ocgcore : ServantWithCardDescription ...@@ -6216,7 +6218,6 @@ public class Ocgcore : ServantWithCardDescription
} }
sendReturn(m.get()); sendReturn(m.get());
break; break;
} }
} }
......
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