Commit 65d1e5d4 authored by VanillaSalt's avatar VanillaSalt

fix extra pendulum count for tag

parent 664314d5
...@@ -2930,6 +2930,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -2930,6 +2930,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); int player = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
size_t mcount = (size_t)BufferIO::ReadInt8(pbuf); size_t mcount = (size_t)BufferIO::ReadInt8(pbuf);
size_t ecount = (size_t)BufferIO::ReadInt8(pbuf); size_t ecount = (size_t)BufferIO::ReadInt8(pbuf);
size_t pcount = (size_t)BufferIO::ReadInt8(pbuf);
size_t hcount = (size_t)BufferIO::ReadInt8(pbuf); size_t hcount = (size_t)BufferIO::ReadInt8(pbuf);
int topcode = BufferIO::ReadInt32(pbuf); int topcode = BufferIO::ReadInt32(pbuf);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) { if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
...@@ -3004,6 +3005,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3004,6 +3005,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.extra[player].push_back(ccard); mainGame->dField.extra[player].push_back(ccard);
} }
} }
mainGame->dField.extra_p_count[player] = pcount;
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping)
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
// //
...@@ -3027,7 +3029,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -3027,7 +3029,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
} }
for (auto cit = mainGame->dField.extra[player].begin(); cit != mainGame->dField.extra[player].end(); ++cit) { for (auto cit = mainGame->dField.extra[player].begin(); cit != mainGame->dField.extra[player].end(); ++cit) {
ClientCard* pcard = *cit; ClientCard* pcard = *cit;
pcard->code = 0; pcard->code = BufferIO::ReadInt32(pbuf) & 0x7fffffff;
mainGame->dField.GetCardLocation(pcard, &pcard->curPos, &pcard->curRot); mainGame->dField.GetCardLocation(pcard, &pcard->curPos, &pcard->curRot);
if(player == 0) pcard->curPos.Y += 2.0f; if(player == 0) pcard->curPos.Y += 2.0f;
else pcard->curPos.Y -= 3.0f; else pcard->curPos.Y -= 3.0f;
......
...@@ -1501,7 +1501,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1501,7 +1501,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf(formatBuffer, L"%ls", dataManager.GetName(mcard->code)); myswprintf(formatBuffer, L"%ls", dataManager.GetName(mcard->code));
str.append(formatBuffer); str.append(formatBuffer);
if(mcard->alias && (mcard->alias < mcard->code - 10 || mcard->alias > mcard->code + 10)) { if(mcard->alias && (mcard->alias < mcard->code - 10 || mcard->alias > mcard->code + 10)) {
myswprintf(formatBuffer, L"\n(%ls)", dataManager.GetName(mcard->alias)); myswprintf(formatBuffer, L"\n%ls", dataManager.GetName(mcard->alias));
str.append(formatBuffer); str.append(formatBuffer);
} }
if(mcard->location == LOCATION_SZONE && (mcard->sequence == 6 || mcard->sequence == 7)) { if(mcard->location == LOCATION_SZONE && (mcard->sequence == 6 || mcard->sequence == 7)) {
......
...@@ -653,7 +653,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) { ...@@ -653,7 +653,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
} }
case MSG_TAG_SWAP: { case MSG_TAG_SWAP: {
player = pbuf[0]; player = pbuf[0];
pbuf += pbuf[3] * 4 + 8; pbuf += pbuf[2] * 4 + pbuf[4] * 4 + 9;
DuelClient::ClientAnalyze(offset, pbuf - offset); DuelClient::ClientAnalyze(offset, pbuf - offset);
ReplayRefreshDeck(player); ReplayRefreshDeck(player);
ReplayRefreshExtra(player); ReplayRefreshExtra(player);
......
...@@ -598,7 +598,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) { ...@@ -598,7 +598,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
} }
case MSG_TAG_SWAP: { case MSG_TAG_SWAP: {
player = pbuf[0]; player = pbuf[0];
pbuf += pbuf[3] * 4 + 8; pbuf += pbuf[2] * 4 + pbuf[4] * 4 + 9;
DuelClient::ClientAnalyze(offset, pbuf - offset); DuelClient::ClientAnalyze(offset, pbuf - offset);
SinglePlayRefreshDeck(player); SinglePlayRefreshDeck(player);
SinglePlayRefreshExtra(player); SinglePlayRefreshExtra(player);
......
...@@ -1319,10 +1319,11 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -1319,10 +1319,11 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
case MSG_TAG_SWAP: { case MSG_TAG_SWAP: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
/*int mcount = */BufferIO::ReadInt8(pbuf); /*int mcount = */BufferIO::ReadInt8(pbuf);
/*int ecount = */BufferIO::ReadInt8(pbuf); int ecount = BufferIO::ReadInt8(pbuf);
/*int pcount = */BufferIO::ReadInt8(pbuf);
int hcount = BufferIO::ReadInt8(pbuf); int hcount = BufferIO::ReadInt8(pbuf);
pbufw = pbuf + 4; pbufw = pbuf + 4;
pbuf += hcount * 4 + 4; pbuf += hcount * 4 + ecount * 4 + 4;
NetServer::SendBufferToPlayer(cur_player[player], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(cur_player[player], STOC_GAME_MSG, offset, pbuf - offset);
for (int i = 0; i < hcount; ++i) { for (int i = 0; i < hcount; ++i) {
if(!(pbufw[3] & 0x80)) if(!(pbufw[3] & 0x80))
...@@ -1330,6 +1331,12 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -1330,6 +1331,12 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
else else
pbufw += 4; pbufw += 4;
} }
for (int i = 0; i < ecount; ++i) {
if(!(pbufw[3] & 0x80))
BufferIO::WriteInt32(pbufw, 0);
else
pbufw += 4;
}
for(int i = 0; i < 4; ++i) for(int i = 0; i < 4; ++i)
if(players[i] != cur_player[player]) if(players[i] != cur_player[player])
NetServer::SendBufferToPlayer(players[i], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(players[i], STOC_GAME_MSG, offset, pbuf - offset);
......
Subproject commit e8420f07388d2f47adab11ba8d3fd5d3462837dd Subproject commit 2ec939e0de46afcb48aba6be7ddb9004bde85d68
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