Commit 01cf7051 authored by nanahira's avatar nanahira

Merge branch 'patch-ccg' of github.com:Fluorohydride/ygopro

parents d21e3fd1 efbaa3ef
Pipeline #5062 canceled with stages
in 6 minutes and 47 seconds
......@@ -73,15 +73,15 @@ const std::unordered_map<int, int>* DeckManager::GetLFListContent(int lfhash) {
return nullptr;
}
int DeckManager::IsGameRuleDisallowed(unsigned char hostInfoRule, unsigned int cardOt) {
bool allow_ocg = hostInfoRule == 0 || hostInfoRule == 4 || hostInfoRule == 2; // OCG can be used in OCG and OT duels
bool allow_tcg = hostInfoRule == 1 || hostInfoRule == 2; // TCG can be used in TCG and OT duels
bool allow_ccg = hostInfoRule == 0 || hostInfoRule == 4 || hostInfoRule == 2; // CCG can be used in OCG, CCG and OT duels
if(!allow_ocg && ((cardOt & 0x3) == 0x1))
return DECKERROR_OCGONLY;
if(!allow_tcg && ((cardOt & 0x3) == 0x2))
return DECKERROR_TCGONLY;
if(hostInfoRule == 4 && !(cardOt & 0x8) && (cardOt & 0x3)) { // in CCG duels, cards labeled with ither OCG or TCG, but not CCG, would not be allowed.
if(cardOt & 0x3 == 0x2) {
if(hostInfoRule != 4) { // non-CCG
bool allow_ocg = hostInfoRule == 0 || hostInfoRule == 2; // OCG can be used in OCG and OT duels
bool allow_tcg = hostInfoRule == 1 || hostInfoRule == 2; // TCG can be used in TCG and OT duels
if(!allow_ocg && ((cardOt & 0x3) == 0x1))
return DECKERROR_OCGONLY;
if(!allow_tcg && ((cardOt & 0x3) == 0x2))
return DECKERROR_TCGONLY;
} else if((cardOt & 0x8) && (cardOt & 0x3)) { // in CCG duels, cards labeled with ither OCG or TCG, but not CCG, would not be allowed.
if((cardOt & 0x3) == 0x2) {
return DECKERROR_TCGONLY;
} else {
return DECKERROR_OCGONLY;
......
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