Commit 0a96956a authored by mercury233's avatar mercury233 Committed by GitHub

fix animation of card moving to extra (#2856)

parent a789c1bb
......@@ -35,8 +35,12 @@ void ClientCard::SetCode(unsigned int x) {
if((location == LOCATION_HAND) && (code != x)) {
code = x;
mainGame->dField.MoveCard(this, 5);
} else
} else {
if (x == 0 && code != 0) {
chain_code = code;
}
code = x;
}
}
void ClientCard::UpdateInfo(unsigned char* buf) {
int flag = BufferIO::Read<int32_t>(buf);
......@@ -48,11 +52,7 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
int pdata = BufferIO::Read<int32_t>(buf);
if (!pdata)
ClearData();
if((location == LOCATION_HAND) && ((unsigned int)pdata != code)) {
code = pdata;
mainGame->dField.MoveCard(this, 5);
} else
code = pdata;
SetCode(pdata);
}
if(flag & QUERY_POSITION) {
int pdata = (BufferIO::Read<int32_t>(buf) >> 24) & 0xff;
......
......@@ -348,6 +348,7 @@ void Game::DrawCard(ClientCard* pcard) {
if(pcard->aniFrame == 0) {
pcard->is_moving = false;
pcard->is_fading = false;
pcard->chain_code = 0;
}
}
matManager.mCard.AmbientColor = 0xffffffff;
......@@ -355,7 +356,10 @@ void Game::DrawCard(ClientCard* pcard) {
driver->setTransform(irr::video::ETS_WORLD, pcard->mTransform);
auto m22 = pcard->mTransform(2, 2);
if(m22 > -0.99 || pcard->is_moving) {
matManager.mCard.setTexture(0, imageManager.GetTexture(pcard->code));
auto code = pcard->code;
if (code == 0 && pcard->is_moving)
code = pcard->chain_code;
matManager.mCard.setTexture(0, imageManager.GetTexture(code));
driver->setMaterial(matManager.mCard);
driver->drawVertexPrimitiveList(matManager.vCardFront, 4, matManager.iRectangle, 2);
}
......
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