Commit 673e09d5 authored by Argon's avatar Argon

fix crash

parent 75efd24b
...@@ -1150,7 +1150,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1150,7 +1150,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int forced = BufferIO::ReadInt8(pbuf); int forced = BufferIO::ReadInt8(pbuf);
/*int hint0 = */BufferIO::ReadInt32(pbuf); /*int hint0 = */BufferIO::ReadInt32(pbuf);
/*int hint1 = */BufferIO::ReadInt32(pbuf); /*int hint1 = */BufferIO::ReadInt32(pbuf);
int c, l, s/*, code*/, desc; int c, l, s, ss, desc;
ClientCard* pcard; ClientCard* pcard;
mainGame->dField.chain_forced = (forced != 0); mainGame->dField.chain_forced = (forced != 0);
mainGame->dField.activatable_cards.clear(); mainGame->dField.activatable_cards.clear();
...@@ -1160,8 +1160,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1160,8 +1160,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf)); c = mainGame->LocalPlayer(BufferIO::ReadInt8(pbuf));
l = BufferIO::ReadInt8(pbuf); l = BufferIO::ReadInt8(pbuf);
s = BufferIO::ReadInt8(pbuf); s = BufferIO::ReadInt8(pbuf);
ss = BufferIO::ReadInt8(pbuf);
desc = BufferIO::ReadInt32(pbuf); desc = BufferIO::ReadInt32(pbuf);
pcard = mainGame->dField.GetCard(c, l, s); pcard = mainGame->dField.GetCard(c, l, s, ss);
mainGame->dField.activatable_cards.push_back(pcard); mainGame->dField.activatable_cards.push_back(pcard);
mainGame->dField.activatable_descs.push_back(desc); mainGame->dField.activatable_descs.push_back(desc);
pcard->is_selectable = true; pcard->is_selectable = true;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <dirent.h> #include <dirent.h>
#endif #endif
const unsigned short PRO_VERSION = 0x1331; const unsigned short PRO_VERSION = 0x1332;
namespace ygo { namespace ygo {
......
...@@ -281,7 +281,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) { ...@@ -281,7 +281,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
case MSG_SELECT_CHAIN: { case MSG_SELECT_CHAIN: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += 10 + count * 11; pbuf += 10 + count * 12;
return ReadReplayResponse(); return ReadReplayResponse();
} }
case MSG_SELECT_PLACE: case MSG_SELECT_PLACE:
......
...@@ -692,7 +692,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -692,7 +692,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
case MSG_SELECT_CHAIN: { case MSG_SELECT_CHAIN: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += 10 + count * 11; pbuf += 10 + count * 12;
WaitforResponse(player); WaitforResponse(player);
NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(players[player], STOC_GAME_MSG, offset, pbuf - offset);
return 1; return 1;
......
...@@ -213,7 +213,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) { ...@@ -213,7 +213,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
case MSG_SELECT_CHAIN: { case MSG_SELECT_CHAIN: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += 10 + count * 11; pbuf += 10 + count * 12;
if(!DuelClient::ClientAnalyze(offset, pbuf - offset)) { if(!DuelClient::ClientAnalyze(offset, pbuf - offset)) {
mainGame->singleSignal.Reset(); mainGame->singleSignal.Reset();
mainGame->singleSignal.Wait(); mainGame->singleSignal.Wait();
......
...@@ -625,7 +625,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) { ...@@ -625,7 +625,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
case MSG_SELECT_CHAIN: { case MSG_SELECT_CHAIN: {
player = BufferIO::ReadInt8(pbuf); player = BufferIO::ReadInt8(pbuf);
count = BufferIO::ReadInt8(pbuf); count = BufferIO::ReadInt8(pbuf);
pbuf += 10 + count * 11; pbuf += 10 + count * 12;
WaitforResponse(player); WaitforResponse(player);
NetServer::SendBufferToPlayer(cur_player[player], STOC_GAME_MSG, offset, pbuf - offset); NetServer::SendBufferToPlayer(cur_player[player], STOC_GAME_MSG, offset, pbuf - offset);
return 1; return 1;
......
...@@ -313,9 +313,7 @@ int32 field::select_chain(uint16 step, uint8 playerid, uint8 spe_count, uint8 fo ...@@ -313,9 +313,7 @@ int32 field::select_chain(uint16 step, uint8 playerid, uint8 spe_count, uint8 fo
effect* peffect = core.select_chains[i].triggering_effect; effect* peffect = core.select_chains[i].triggering_effect;
card* pcard = peffect->handler; card* pcard = peffect->handler;
pduel->write_buffer32(pcard->data.code); pduel->write_buffer32(pcard->data.code);
pduel->write_buffer8(pcard->current.controler); pduel->write_buffer32(pcard->get_info_location());
pduel->write_buffer8(pcard->current.location);
pduel->write_buffer8(pcard->current.sequence);
pduel->write_buffer32(peffect->description); pduel->write_buffer32(peffect->description);
} }
return FALSE; return FALSE;
......
...@@ -99,7 +99,8 @@ function c71645242.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -99,7 +99,8 @@ function c71645242.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c71645242.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(c71645242.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local atk=g:GetSum(Card.GetAttack) local atk=g:GetSum(Card.GetAttack)
local sc=g:FilterCount(Card.IsControler,nil,tp) local sc=g:FilterCount(Card.IsControler,nil,tp)
if chk==0 then return e:GetHandler():IsDestructable(e) and g:GetCount()>0 and (Duel.GetLocationCount(tp,LOCATION_MZONE)>-sc) if chk==0 then return e:GetHandler():IsDestructable() and e:GetHandler():IsDestructable(e) and g:GetCount()>0
and (Duel.GetLocationCount(tp,LOCATION_MZONE)>-sc)
and Duel.IsExistingTarget(c71645242.filter2,tp,LOCATION_GRAVE,0,1,nil,atk,e,tp) end and Duel.IsExistingTarget(c71645242.filter2,tp,LOCATION_GRAVE,0,1,nil,atk,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectTarget(tp,c71645242.filter2,tp,LOCATION_GRAVE,0,1,1,nil,atk,e,tp) local tg=Duel.SelectTarget(tp,c71645242.filter2,tp,LOCATION_GRAVE,0,1,1,nil,atk,e,tp)
......
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