Commit c0ba3783 authored by VanillaSalt's avatar VanillaSalt

fix

parent cef3565d
...@@ -238,7 +238,7 @@ uint32 card::get_another_code() { ...@@ -238,7 +238,7 @@ uint32 card::get_another_code() {
} }
int32 card::is_set_card(uint32 set_code) { int32 card::is_set_card(uint32 set_code) {
uint32 code = get_code(); uint32 code = get_code();
uint32 setcode; uint64 setcode;
if (code == data.code) { if (code == data.code) {
setcode = data.setcode; setcode = data.setcode;
} else { } else {
...@@ -252,6 +252,8 @@ int32 card::is_set_card(uint32 set_code) { ...@@ -252,6 +252,8 @@ int32 card::is_set_card(uint32 set_code) {
return TRUE; return TRUE;
if (((setcode >> 16) & 0xfff) == settype && ((setcode >> 16) & 0xf000 & setsubtype) == setsubtype) if (((setcode >> 16) & 0xfff) == settype && ((setcode >> 16) & 0xf000 & setsubtype) == setsubtype)
return TRUE; return TRUE;
if (((setcode >> 24) & 0xfff) == settype && ((setcode >> 24) & 0xf000 & setsubtype) == setsubtype)
return TRUE;
return FALSE; return FALSE;
} }
uint32 card::get_type() { uint32 card::get_type() {
......
...@@ -704,9 +704,10 @@ void field::add_effect(effect* peffect, uint8 owner_player) { ...@@ -704,9 +704,10 @@ void field::add_effect(effect* peffect, uint8 owner_player) {
} }
} }
void field::remove_effect(effect* peffect) { void field::remove_effect(effect* peffect) {
if (effects.indexer.find(peffect) == effects.indexer.end()) auto eit = effects.indexer.find(peffect);
if (eit == effects.indexer.end())
return; return;
auto it = effects.indexer[peffect]; auto it = eit->second;
if (!(peffect->type & EFFECT_TYPE_ACTIONS)) if (!(peffect->type & EFFECT_TYPE_ACTIONS))
effects.aura_effect.erase(it); effects.aura_effect.erase(it);
else { else {
......
...@@ -2368,9 +2368,9 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -2368,9 +2368,9 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
dest = ((*cit)->operation_param >> 8) & 0xff; dest = ((*cit)->operation_param >> 8) & 0xff;
if(!dest) if(!dest)
dest = LOCATION_GRAVE; dest = LOCATION_GRAVE;
if((dest == LOCATION_HAND && (*cit)->is_affected_by_effect(EFFECT_CANNOT_TO_HAND)) if((dest == LOCATION_HAND && !(*cit)->is_capable_send_to_hand(reason_player))
|| (dest == LOCATION_DECK && (*cit)->is_affected_by_effect(EFFECT_CANNOT_TO_DECK)) || (dest == LOCATION_DECK && !(*cit)->is_capable_send_to_deck(reason_player))
|| (dest == LOCATION_REMOVED && (*cit)->is_affected_by_effect(EFFECT_CANNOT_REMOVE))) || (dest == LOCATION_REMOVED && !(*cit)->is_removeable(reason_player)))
dest = LOCATION_GRAVE; dest = LOCATION_GRAVE;
(*cit)->operation_param = ((*cit)->operation_param & 0xffff00ff) + (dest << 8); (*cit)->operation_param = ((*cit)->operation_param & 0xffff00ff) + (dest << 8);
} }
......
...@@ -481,7 +481,7 @@ int32 field::process() { ...@@ -481,7 +481,7 @@ int32 field::process() {
if(!attacker if(!attacker
|| (attacker->fieldid_r != core.pre_field[0]) || (attacker->fieldid_r != core.pre_field[0])
|| (attacker->current.position & POS_FACEDOWN) || (attacker->current.position & POS_FACEDOWN)
|| (attacker->current.position & POS_DEFENCE && !(attacker->is_affected_by_effect(EFFECT_DEFENCE_ATTACK))) || ((attacker->current.position & POS_DEFENCE) && !(attacker->is_affected_by_effect(EFFECT_DEFENCE_ATTACK)))
|| attacker->is_affected_by_effect(EFFECT_ATTACK_DISABLED) || attacker->is_affected_by_effect(EFFECT_ATTACK_DISABLED)
|| !attacker->is_affect_by_effect(core.reason_effect)) { || !attacker->is_affect_by_effect(core.reason_effect)) {
returns.ivalue[0] = 0; returns.ivalue[0] = 0;
...@@ -3745,7 +3745,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3745,7 +3745,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
card* pcard; card* pcard;
for(auto elit = core.used_event.begin(); elit != core.used_event.end(); ++elit) { for(auto elit = core.used_event.begin(); elit != core.used_event.end(); ++elit) {
if(elit->event_cards) if(elit->event_cards)
pduel->delete_group((group*)elit->event_cards); pduel->delete_group(elit->event_cards);
} }
core.used_event.clear(); core.used_event.clear();
for(auto eit = core.reseted_effects.begin(); eit != core.reseted_effects.end(); ++eit) { for(auto eit = core.reseted_effects.begin(); eit != core.reseted_effects.end(); ++eit) {
......
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