Commit d63e5177 authored by mercury233's avatar mercury233

replace 0x80 with LOCATION_OVERLAY

parent b68249ed
......@@ -124,7 +124,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:
......
......@@ -2545,7 +2545,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);
......@@ -2608,7 +2608,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);
......@@ -2628,7 +2628,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();
......@@ -2637,7 +2637,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 == 0x4) {
mainGame->gMutex.lock();
......@@ -2649,7 +2649,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.isReplay && mainGame->dInfo.isReplaySkiping) {
......@@ -2686,7 +2686,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;
......@@ -2696,7 +2696,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;
......@@ -2995,7 +2995,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);
......@@ -3825,7 +3825,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;
......
......@@ -544,7 +544,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);
......
......@@ -964,7 +964,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;
}
......
......@@ -445,7 +445,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;
}
......
......@@ -936,7 +936,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