Commit 765670b6 authored by IceYGO's avatar IceYGO

Fix RELOAD_FIELD message handling

parent 78b24970
......@@ -3085,28 +3085,34 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.AddCard(ccard, p, LOCATION_DECK, seq);
mainGame->dField.GetCardLocation(ccard, &ccard->curPos, &ccard->curRot, true);
}
val = BufferIO::ReadInt8(pbuf);
for(int seq = 0; seq < val; ++seq) {
ClientCard* ccard = new ClientCard;
mainGame->dField.AddCard(ccard, p, LOCATION_HAND, seq);
}
// Use another loop to refresh the hand locations to prevent incorrect positioning
for (int seq = 0; seq < val; ++seq) {
ClientCard* ccard = mainGame->dField.hand[p][seq];
mainGame->dField.GetCardLocation(ccard, &ccard->curPos, &ccard->curRot, true);
}
val = BufferIO::ReadInt8(pbuf);
for(int seq = 0; seq < val; ++seq) {
ClientCard* ccard = new ClientCard;
mainGame->dField.AddCard(ccard, p, LOCATION_EXTRA, seq);
mainGame->dField.AddCard(ccard, p, LOCATION_GRAVE, seq);
mainGame->dField.GetCardLocation(ccard, &ccard->curPos, &ccard->curRot, true);
}
val = BufferIO::ReadInt8(pbuf);
for(int seq = 0; seq < val; ++seq) {
ClientCard* ccard = new ClientCard;
mainGame->dField.AddCard(ccard, p, LOCATION_GRAVE, seq);
mainGame->dField.AddCard(ccard, p, LOCATION_REMOVED, seq);
mainGame->dField.GetCardLocation(ccard, &ccard->curPos, &ccard->curRot, true);
}
val = BufferIO::ReadInt8(pbuf);
for(int seq = 0; seq < val; ++seq) {
ClientCard* ccard = new ClientCard;
mainGame->dField.AddCard(ccard, p, LOCATION_REMOVED, seq);
mainGame->dField.AddCard(ccard, p, LOCATION_EXTRA, seq);
mainGame->dField.GetCardLocation(ccard, &ccard->curPos, &ccard->curRot, true);
}
val = BufferIO::ReadInt8(pbuf);
......
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