Commit 234a80bb authored by argon.sun's avatar argon.sun

fix

parent 57e9db08
......@@ -124,7 +124,7 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
pcard->sequence = sequence;
switch(location) {
case LOCATION_DECK: {
if (sequence != 1 || deck[controler].size() == 0) {
if (sequence != 0 || deck[controler].size() == 0) {
deck[controler].push_back(pcard);
pcard->sequence = deck[controler].size() - 1;
} else {
......
......@@ -441,14 +441,16 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->gMutex.Unlock();
mainGame->replaySignal.Reset();
mainGame->replaySignal.Wait();
if(mainGame->actionParam) {
if(mainGame->actionParam || !is_host) {
char* prep = pdata;
Replay new_replay;
memcpy(&new_replay.pheader, prep, sizeof(ReplayHeader));
prep += sizeof(ReplayHeader);
memcpy(new_replay.comp_data, prep, len - sizeof(ReplayHeader) - 1);
new_replay.comp_size = len - sizeof(ReplayHeader) - 1;
new_replay.SaveReplay(mainGame->ebRSName->getText());
if(mainGame->actionParam)
new_replay.SaveReplay(mainGame->ebRSName->getText());
else new_replay.SaveReplay(L"_LastReplay");
}
break;
}
......@@ -1232,19 +1234,22 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame->dField.selectable_cards.clear();
for (int i = 0; i < count; ++i) {
code = BufferIO::ReadInt32(pbuf);
c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
l = BufferIO::ReadInt8(pbuf);
s = BufferIO::ReadInt8(pbuf);
pcard = mainGame->dField.GetCard(c, l, s);
pbuf += 3;
pcard = *(mainGame->dField.deck[player].rbegin() + i);
if (code != 0)
pcard->SetCode(code);
}
for (int i = 0; i < count; ++i) {
pcard = *(mainGame->dField.deck[player].rbegin() + i);
myswprintf(textBuffer, L"*[%ls]", dataManager.GetName(code));
mainGame->lstLog->addItem(textBuffer);
mainGame->logParam.push_back(code);
float shift = -0.15f;
if (player == 1) shift = 0.15f;
pcard->dPos = irr::core::vector3df(shift, 0, 0);
pcard->dRot = irr::core::vector3df(0, 3.14159f / 5.0f, 0);
if(!mainGame->dField.deck_reversed)
pcard->dRot = irr::core::vector3df(0, 3.14159f / 5.0f, 0);
else pcard->dRot = irr::core::vector3df(0, 0, 0);
pcard->is_moving = true;
pcard->aniFrame = 5;
mainGame->WaitFrameSignal(45);
......@@ -1279,7 +1284,9 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
float shift = -0.15f;
if (c == 0 && l == 0x40) shift = 0.15f;
pcard->dPos = irr::core::vector3df(shift, 0, 0);
pcard->dRot = irr::core::vector3df(0, 3.14159f / 5.0f, 0);
if((l == LOCATION_DECK) && mainGame->dField.deck_reversed)
pcard->dRot = irr::core::vector3df(0, 0, 0);
else pcard->dRot = irr::core::vector3df(0, 3.14159f / 5.0f, 0);
pcard->is_moving = true;
pcard->aniFrame = 5;
mainGame->WaitFrameSignal(45);
......@@ -1596,9 +1603,9 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
mainGame->dField.AddCard(pcard, cc, cl, cs);
mainGame->gMutex.Unlock();
if (pl == cl && pc == cc && (cl & 0x71)) {
pcard->dPos = irr::core::vector3df(-0.2f, 0, 0);
pcard->dPos = irr::core::vector3df(-0.3f, 0, 0);
pcard->dRot = irr::core::vector3df(0, 0, 0);
if (pc == 1) pcard->dPos.X = 0.2f;
if (pc == 1) pcard->dPos.X = 0.3f;
pcard->is_moving = true;
pcard->aniFrame = 5;
mainGame->WaitFrameSignal(5);
......@@ -1963,10 +1970,13 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
ClientCard* pcard;
for (int i = 0; i < count; ++i) {
int code = BufferIO::ReadInt32(pbuf);
pcard = mainGame->dField.GetCard(player, LOCATION_DECK, mainGame->dField.deck[player].size() - 1 - i);
if(code)
pcard->SetCode(code);
}
for (int i = 0; i < count; ++i) {
mainGame->gMutex.Lock();
pcard = mainGame->dField.GetCard(player, LOCATION_DECK, mainGame->dField.deck[player].size() - 1);
if(code || !mainGame->dField.deck_reversed)
pcard->SetCode(code);
mainGame->dField.deck[player].erase(mainGame->dField.deck[player].end() - 1);
mainGame->dField.AddCard(pcard, player, LOCATION_HAND, 0);
for(int i = 0; i < mainGame->dField.hand[player].size(); ++i)
......
......@@ -258,8 +258,7 @@ int32 effect::is_activate_ready(uint8 playerid, tevent& e, int32 neglect_cond, i
return TRUE;
}
int32 effect::is_condition_check(uint8 playerid, tevent& e) {
if((handler->current.location & (LOCATION_ONFIELD | LOCATION_REMOVED))
&& (!handler->is_position(POS_FACEUP) || !handler->is_status(STATUS_EFFECT_ENABLED)))
if((handler->current.location & (LOCATION_ONFIELD | LOCATION_REMOVED)) && (!handler->is_position(POS_FACEUP)))
return FALSE;
if(!condition)
return TRUE;
......
......@@ -947,8 +947,12 @@ int32 field::process() {
tc[count - i - 1]->current.sequence = player[target_player].list_main.size() - 1;
}
}
pduel->write_buffer8(MSG_REFRESH_DECK);
pduel->write_buffer8(target_player);
if(core.deck_reversed) {
pduel->write_buffer8(MSG_DECK_TOP);
pduel->write_buffer8(target_player);
pduel->write_buffer8(0);
pduel->write_buffer32((*player[target_player].list_main.rbegin())->data.code);
}
core.units.pop_front();
}
return pduel->bufferlen;
......
......@@ -41,6 +41,7 @@ function c87624166.destg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c87624166.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c87624166.desfilter,Duel.GetTurnPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
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