Commit e86953be authored by nanahira's avatar nanahira

sideins

parent 57f42254
...@@ -590,20 +590,33 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -590,20 +590,33 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
new_card(pduel, pdeck[0].main[i]->first, 0, 0, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE); new_card(pduel, pdeck[0].main[i]->first, 0, 0, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(pdeck[0].main[i]->first, false); last_replay.WriteInt32(pdeck[0].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[0].extra.size(), false); std::vector<ygo::code_pointer> extra_cards;
for(int32 i = (int32)pdeck[0].extra.size() - 1; i >= 0; --i) { extra_cards.clear();
new_card(pduel, pdeck[0].extra[i]->first, 0, 0, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE); for(auto cit : pdeck[0].extra)
last_replay.WriteInt32(pdeck[0].extra[i]->first, false); extra_cards.push_back(cit);
for(auto cit : pdeck[0].side)
if(cit->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK))
extra_cards.push_back(cit);
last_replay.WriteInt32(extra_cards.size(), false);
for(int32 i = (int32)extra_cards.size() - 1; i >= 0; --i) {
new_card(pduel, extra_cards[i]->first, 0, 0, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(extra_cards[i]->first, false);
} }
last_replay.WriteInt32(pdeck[1].main.size(), false); last_replay.WriteInt32(pdeck[1].main.size(), false);
for(int32 i = (int32)pdeck[1].main.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[1].main.size() - 1; i >= 0; --i) {
new_card(pduel, pdeck[1].main[i]->first, 1, 1, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE); new_card(pduel, pdeck[1].main[i]->first, 1, 1, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(pdeck[1].main[i]->first, false); last_replay.WriteInt32(pdeck[1].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[1].extra.size(), false); extra_cards.clear();
for(int32 i = (int32)pdeck[1].extra.size() - 1; i >= 0; --i) { for(auto cit : pdeck[1].extra)
new_card(pduel, pdeck[1].extra[i]->first, 1, 1, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE); extra_cards.push_back(cit);
last_replay.WriteInt32(pdeck[1].extra[i]->first, false); for(auto cit : pdeck[1].side)
if(cit->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK))
extra_cards.push_back(cit);
last_replay.WriteInt32(extra_cards.size(), false);
for(int32 i = (int32)extra_cards.size() - 1; i >= 0; --i) {
new_card(pduel, extra_cards[i]->first, 1, 1, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(extra_cards[i]->first, false);
} }
last_replay.Flush(); last_replay.Flush();
unsigned char startbuf[32]; unsigned char startbuf[32];
......
...@@ -572,10 +572,17 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -572,10 +572,17 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
new_card(pduel, pdeck[0].main[i]->first, 0, 0, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE); new_card(pduel, pdeck[0].main[i]->first, 0, 0, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(pdeck[0].main[i]->first, false); last_replay.WriteInt32(pdeck[0].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[0].extra.size(), false); std::vector<ygo::code_pointer> extra_cards;
for(int32 i = (int32)pdeck[0].extra.size() - 1; i >= 0; --i) { extra_cards.clear();
new_card(pduel, pdeck[0].extra[i]->first, 0, 0, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE); for(auto cit : pdeck[0].extra)
last_replay.WriteInt32(pdeck[0].extra[i]->first, false); extra_cards.push_back(cit);
for(auto cit : pdeck[0].side)
if(cit->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK))
extra_cards.push_back(cit);
last_replay.WriteInt32(extra_cards.size(), false);
for(int32 i = (int32)extra_cards.size() - 1; i >= 0; --i) {
new_card(pduel, extra_cards[i]->first, 0, 0, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(extra_cards[i]->first, false);
} }
// //
last_replay.WriteInt32(pdeck[1].main.size(), false); last_replay.WriteInt32(pdeck[1].main.size(), false);
...@@ -583,10 +590,16 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -583,10 +590,16 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
new_tag_card(pduel, pdeck[1].main[i]->first, 0, LOCATION_DECK); new_tag_card(pduel, pdeck[1].main[i]->first, 0, LOCATION_DECK);
last_replay.WriteInt32(pdeck[1].main[i]->first, false); last_replay.WriteInt32(pdeck[1].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[1].extra.size(), false); extra_cards.clear();
for(int32 i = (int32)pdeck[1].extra.size() - 1; i >= 0; --i) { for(auto cit : pdeck[1].extra)
new_tag_card(pduel, pdeck[1].extra[i]->first, 0, LOCATION_EXTRA); extra_cards.push_back(cit);
last_replay.WriteInt32(pdeck[1].extra[i]->first, false); for(auto cit : pdeck[1].side)
if(cit->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK))
extra_cards.push_back(cit);
last_replay.WriteInt32(extra_cards.size(), false);
for(int32 i = (int32)extra_cards.size() - 1; i >= 0; --i) {
new_tag_card(pduel, extra_cards[i]->first, 0, LOCATION_EXTRA);
last_replay.WriteInt32(extra_cards[i]->first, false);
} }
// //
last_replay.WriteInt32(pdeck[3].main.size(), false); last_replay.WriteInt32(pdeck[3].main.size(), false);
...@@ -594,10 +607,16 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -594,10 +607,16 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
new_card(pduel, pdeck[3].main[i]->first, 1, 1, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE); new_card(pduel, pdeck[3].main[i]->first, 1, 1, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(pdeck[3].main[i]->first, false); last_replay.WriteInt32(pdeck[3].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[3].extra.size(), false); extra_cards.clear();
for(int32 i = (int32)pdeck[3].extra.size() - 1; i >= 0; --i) { for(auto cit : pdeck[3].extra)
new_card(pduel, pdeck[3].extra[i]->first, 1, 1, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE); extra_cards.push_back(cit);
last_replay.WriteInt32(pdeck[3].extra[i]->first, false); for(auto cit : pdeck[3].side)
if(cit->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK))
extra_cards.push_back(cit);
last_replay.WriteInt32(extra_cards.size(), false);
for(int32 i = (int32)extra_cards.size() - 1; i >= 0; --i) {
new_card(pduel, extra_cards[i]->first, 1, 1, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(extra_cards[i]->first, false);
} }
// //
last_replay.WriteInt32(pdeck[2].main.size(), false); last_replay.WriteInt32(pdeck[2].main.size(), false);
...@@ -605,10 +624,16 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -605,10 +624,16 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
new_tag_card(pduel, pdeck[2].main[i]->first, 1, LOCATION_DECK); new_tag_card(pduel, pdeck[2].main[i]->first, 1, LOCATION_DECK);
last_replay.WriteInt32(pdeck[2].main[i]->first, false); last_replay.WriteInt32(pdeck[2].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[2].extra.size(), false); extra_cards.clear();
for(int32 i = (int32)pdeck[2].extra.size() - 1; i >= 0; --i) { for(auto cit : pdeck[2].extra)
new_tag_card(pduel, pdeck[2].extra[i]->first, 1, LOCATION_EXTRA); extra_cards.push_back(cit);
last_replay.WriteInt32(pdeck[2].extra[i]->first, false); for(auto cit : pdeck[2].side)
if(cit->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK))
extra_cards.push_back(cit);
last_replay.WriteInt32(extra_cards.size(), false);
for(int32 i = (int32)extra_cards.size() - 1; i >= 0; --i) {
new_tag_card(pduel, extra_cards[i]->first, 1, LOCATION_EXTRA);
last_replay.WriteInt32(extra_cards[i]->first, false);
} }
last_replay.Flush(); last_replay.Flush();
unsigned char startbuf[32]; unsigned char startbuf[32];
......
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