Commit 25824a09 authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:Fluorohydride/ygopro

parents 37ed398c d63e5177
......@@ -132,7 +132,7 @@ void ClientField::Initial(int player, int deckc, int extrac) {
}
ClientCard* ClientField::GetCard(int controler, int location, int sequence, int sub_seq) {
std::vector<ClientCard*>* lst = 0;
bool is_xyz = (location & 0x80) != 0;
bool is_xyz = (location & LOCATION_OVERLAY) != 0;
location &= 0x7f;
switch(location) {
case LOCATION_DECK:
......
......@@ -2775,7 +2775,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.RemoveCard(pc, pl, ps);
delete pcard;
} else {
if (!(pl & 0x80) && !(cl & 0x80)) {
if (!(pl & LOCATION_OVERLAY) && !(cl & LOCATION_OVERLAY)) {
ClientCard* pcard = mainGame->dField.GetCard(pc, pl, ps);
if (pcard->code != code && (code != 0 || cl == 0x40))
pcard->SetCode(code);
......@@ -2838,7 +2838,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->WaitFrameSignal(5);
}
}
} else if (!(pl & 0x80)) {
} else if (!(pl & LOCATION_OVERLAY)) {
ClientCard* pcard = mainGame->dField.GetCard(pc, pl, ps);
if (code != 0 && pcard->code != code)
pcard->SetCode(code);
......@@ -2858,7 +2858,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
olcard->overlayed.push_back(pcard);
mainGame->dField.overlay_cards.insert(pcard);
pcard->overlayTarget = olcard;
pcard->location = 0x80;
pcard->location = LOCATION_OVERLAY;
pcard->sequence = olcard->overlayed.size() - 1;
} else {
mainGame->gMutex.lock();
......@@ -2867,7 +2867,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->dField.overlay_cards.insert(pcard);
mainGame->gMutex.unlock();
pcard->overlayTarget = olcard;
pcard->location = 0x80;
pcard->location = LOCATION_OVERLAY;
pcard->sequence = olcard->overlayed.size() - 1;
if (olcard->location & 0x0c) {
mainGame->gMutex.lock();
......@@ -2879,7 +2879,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame->WaitFrameSignal(5);
}
}
} else if (!(cl & 0x80)) {
} else if (!(cl & LOCATION_OVERLAY)) {
ClientCard* olcard = mainGame->dField.GetCard(pc, pl & 0x7f, ps);
ClientCard* pcard = olcard->overlayed[pp];
if(mainGame->dInfo.isReplaySkiping) {
......@@ -2916,7 +2916,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
olcard1->overlayed.erase(olcard1->overlayed.begin() + pcard->sequence);
olcard2->overlayed.push_back(pcard);
pcard->sequence = olcard2->overlayed.size() - 1;
pcard->location = 0x80;
pcard->location = LOCATION_OVERLAY;
pcard->overlayTarget = olcard2;
for (size_t i = 0; i < olcard1->overlayed.size(); ++i) {
olcard1->overlayed[i]->sequence = i;
......@@ -2926,7 +2926,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
olcard1->overlayed.erase(olcard1->overlayed.begin() + pcard->sequence);
olcard2->overlayed.push_back(pcard);
pcard->sequence = olcard2->overlayed.size() - 1;
pcard->location = 0x80;
pcard->location = LOCATION_OVERLAY;
pcard->overlayTarget = olcard2;
for (size_t i = 0; i < olcard1->overlayed.size(); ++i) {
olcard1->overlayed[i]->sequence = i;
......@@ -3240,7 +3240,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int l = BufferIO::ReadInt8(pbuf);
int s = BufferIO::ReadInt8(pbuf);
int ss = BufferIO::ReadInt8(pbuf);
if ((l & 0x80) > 0)
if ((l & LOCATION_OVERLAY) > 0)
pcards[i] = mainGame->dField.GetCard(c, l & 0x7f, s)->overlayed[ss];
else
pcards[i] = mainGame->dField.GetCard(c, l, s);
......@@ -4092,7 +4092,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
ccard->overlayed.push_back(xcard);
mainGame->dField.overlay_cards.insert(xcard);
xcard->overlayTarget = ccard;
xcard->location = 0x80;
xcard->location = LOCATION_OVERLAY;
xcard->sequence = ccard->overlayed.size() - 1;
xcard->owner = p;
xcard->controler = p;
......
......@@ -562,7 +562,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
/*int cp = pbuf[11];*/
pbuf += 16;
DuelClient::ClientAnalyze(offset, pbuf - offset);
if(cl && !(cl & 0x80) && (pl != cl || pc != cc))
if(cl && !(cl & LOCATION_OVERLAY) && (pl != cl || pc != cc))
ReplayRefreshSingle(cc, cl, cs);
else if(pl == cl && cl == LOCATION_DECK)
ReplayRefreshDeck(cc);
......
......@@ -983,7 +983,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
NetServer::SendBufferToPlayer(players[1 - cc], STOC_GAME_MSG, offset, pbuf - offset);
for(auto oit = observers.begin(); oit != observers.end(); ++oit)
NetServer::ReSendToPlayer(*oit);
if (cl != 0 && (cl & 0x80) == 0 && (cl != pl || pc != cc))
if (cl != 0 && (cl & LOCATION_OVERLAY) == 0 && (cl != pl || pc != cc))
RefreshSingle(cc, cl, cs);
break;
}
......
......@@ -452,7 +452,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
/*int cp = pbuf[11];*/
pbuf += 16;
DuelClient::ClientAnalyze(offset, pbuf - offset);
if(cl && !(cl & 0x80) && (pl != cl || pc != cc))
if(cl && !(cl & LOCATION_OVERLAY) && (pl != cl || pc != cc))
SinglePlayRefreshSingle(cc, cl, cs);
break;
}
......
......@@ -972,7 +972,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
NetServer::SendBufferToPlayer(players[i], STOC_GAME_MSG, offset, pbuf - offset);
for(auto oit = observers.begin(); oit != observers.end(); ++oit)
NetServer::ReSendToPlayer(*oit);
if (cl != 0 && (cl & 0x80) == 0 && (cl != pl || pc != cc))
if (cl != 0 && (cl & LOCATION_OVERLAY) == 0 && (cl != pl || pc != cc))
RefreshSingle(cc, cl, cs);
break;
}
......
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