Commit bf72e8c6 authored by VanillaSalt's avatar VanillaSalt

fix

parent 76b564b8
......@@ -443,7 +443,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
if(!is_draging)
break;
if(!mainGame->is_siding) {
if((hovered_pos == 1 && (draging_pointer->second.type & 0x802040)) || (hovered_pos == 2 && !(draging_pointer->second.type & 0x802040)))
if((hovered_pos == 1 && (draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)))
|| (hovered_pos == 2 && !(draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK))))
hovered_pos = 0;
if((hovered_pos == 1 || (hovered_pos == 0 && click_pos == 1)) && deckManager.current_deck.main.size() < 60) {
if(hovered_seq == -1)
......@@ -469,7 +470,9 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
} else if (hovered_pos == 4)
is_draging = false;
} else {
if((hovered_pos == 1 && (draging_pointer->second.type & 0x802040)) || (hovered_pos == 2 && !(draging_pointer->second.type & 0x802040)) || hovered_pos == 4)
if((hovered_pos == 1 && (draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)))
|| (hovered_pos == 2 && !(draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)))
|| hovered_pos == 4)
hovered_pos = 0;
if((hovered_pos == 1 || (hovered_pos == 0 && click_pos == 1)) && deckManager.current_deck.main.size() < 65) {
if(hovered_seq == -1)
......@@ -525,11 +528,11 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
deckManager.current_deck.side.push_back(draging_pointer);
}
} else {
if((draging_pointer->second.type & 0x802040) && deckManager.current_deck.extra.size() < 20) {
if((draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && deckManager.current_deck.extra.size() < 20) {
deckManager.current_deck.side.erase(deckManager.current_deck.side.begin() + hovered_seq);
deckManager.current_deck.extra.push_back(draging_pointer);
}
if(!(draging_pointer->second.type & 0x802040) && deckManager.current_deck.main.size() < 64) {
if(!(draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && deckManager.current_deck.main.size() < 64) {
deckManager.current_deck.side.erase(deckManager.current_deck.side.begin() + hovered_seq);
deckManager.current_deck.main.push_back(draging_pointer);
}
......@@ -563,10 +566,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
if(!is_draging)
deckManager.current_deck.side.erase(deckManager.current_deck.side.begin() + hovered_seq);
else {
if((draging_pointer->second.type & 0x802040) && deckManager.current_deck.extra.size() < 15) {
if((draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && deckManager.current_deck.extra.size() < 15) {
deckManager.current_deck.extra.push_back(draging_pointer);
is_draging = false;
} else if(!(draging_pointer->second.type & 0x802040) && deckManager.current_deck.main.size() < 60) {
} else if(!(draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && deckManager.current_deck.main.size() < 60) {
deckManager.current_deck.main.push_back(draging_pointer);
is_draging = false;
}
......@@ -596,9 +599,9 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
limit--;
if(limit <= 0)
break;
if((draging_pointer->second.type & 0x802040) && deckManager.current_deck.extra.size() < 15) {
if((draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && deckManager.current_deck.extra.size() < 15) {
deckManager.current_deck.extra.push_back(draging_pointer);
} else if(!(draging_pointer->second.type & 0x802040) && deckManager.current_deck.main.size() < 60) {
} else if(!(draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && deckManager.current_deck.main.size() < 60) {
deckManager.current_deck.main.push_back(draging_pointer);
} else if (deckManager.current_deck.side.size() < 15) {
deckManager.current_deck.side.push_back(draging_pointer);
......@@ -649,15 +652,15 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
if (deckManager.current_deck.side.size() < 15)
deckManager.current_deck.side.push_back(draging_pointer);
else {
if ((draging_pointer->second.type & 0x802040) && deckManager.current_deck.extra.size() < 15)
if ((draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && deckManager.current_deck.extra.size() < 15)
deckManager.current_deck.extra.push_back(draging_pointer);
else if (!(draging_pointer->second.type & 0x802040) && deckManager.current_deck.main.size() < 60)
else if (!(draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && deckManager.current_deck.main.size() < 60)
deckManager.current_deck.main.push_back(draging_pointer);
}
} else {
if ((draging_pointer->second.type & 0x802040) && deckManager.current_deck.extra.size() < 15)
if ((draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && deckManager.current_deck.extra.size() < 15)
deckManager.current_deck.extra.push_back(draging_pointer);
else if (!(draging_pointer->second.type & 0x802040) && deckManager.current_deck.main.size() < 60)
else if (!(draging_pointer->second.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && deckManager.current_deck.main.size() < 60)
deckManager.current_deck.main.push_back(draging_pointer);
else if (deckManager.current_deck.side.size() < 15)
deckManager.current_deck.side.push_back(draging_pointer);
......
......@@ -127,7 +127,7 @@ void DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec) {
continue;
if(cd.type & TYPE_TOKEN)
continue;
else if(cd.type & 0x4802040 && deck.extra.size() < 15) {
else if(cd.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK) && deck.extra.size() < 15) {
deck.extra.push_back(dataManager.GetCodePointer(code)); //verified by GetData()
} else if(deck.main.size() < 60) {
deck.main.push_back(dataManager.GetCodePointer(code));
......
......@@ -1773,7 +1773,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
(*cit)->location = LOCATION_GRAVE;
int m = 0;
for (auto cit = mainGame->dField.deck[player].begin(); cit != mainGame->dField.deck[player].end(); ) {
if ((*cit)->type & 0x802040) {
if ((*cit)->type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) {
(*cit)->position = POS_FACEDOWN;
mainGame->dField.AddCard(*cit, player, LOCATION_EXTRA, 0);
cit = mainGame->dField.deck[player].erase(cit);
......@@ -1793,7 +1793,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int m = 0;
for (auto cit = mainGame->dField.deck[player].begin(); cit != mainGame->dField.deck[player].end(); ) {
ClientCard* pcard = *cit;
if (pcard->type & 0x802040) {
if (pcard->type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) {
pcard->position = POS_FACEDOWN;
mainGame->dField.AddCard(pcard, player, LOCATION_EXTRA, 0);
cit = mainGame->dField.deck[player].erase(cit);
......
Subproject commit c49a463fab6446c90354a12cb3f6377cb1c3bbba
Subproject commit f7212e86adc50d53a854691bbcb61ae82276202a
Subproject commit 5bac33f528c7838f1909fd4e460d1b9d5308bdf8
Subproject commit 937e833a299591a46c339695a4c62e0b2af1694a
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