Commit 09d4a3e8 authored by DailyShana's avatar DailyShana

revert and fix

parent 5fac2128
...@@ -3081,9 +3081,13 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -3081,9 +3081,13 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
for (auto cit = targets->container.begin(); cit != targets->container.end();) { for (auto cit = targets->container.begin(); cit != targets->container.end();) {
auto rm = cit++; auto rm = cit++;
card* pcard = *rm; card* pcard = *rm;
if(!pcard->is_destructable()) {
indestructable_set.insert(pcard);
continue;
}
if (!(pcard->current.reason & (REASON_RULE | REASON_COST))) { if (!(pcard->current.reason & (REASON_RULE | REASON_COST))) {
int32 is_destructable = true; bool is_destructable = true;
if (pcard->is_destructable() && pcard->is_affect_by_effect(pcard->current.reason_effect)) { if (pcard->is_affect_by_effect(pcard->current.reason_effect)) {
effect* indestructable_effect = pcard->check_indestructable_by_effect(pcard->current.reason_effect, pcard->current.reason_player); effect* indestructable_effect = pcard->check_indestructable_by_effect(pcard->current.reason_effect, pcard->current.reason_player);
if (indestructable_effect) { if (indestructable_effect) {
if(reason_player != 5) if(reason_player != 5)
...@@ -3280,15 +3284,13 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -3280,15 +3284,13 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
for (auto cit = targets->container.begin(); cit != targets->container.end();) { for (auto cit = targets->container.begin(); cit != targets->container.end();) {
auto rm = cit++; auto rm = cit++;
card* pcard = *rm; card* pcard = *rm;
if (!(pcard->current.reason & REASON_RULE)) { if (!pcard->is_destructable()) {
if (!pcard->is_destructable()) { pcard->current.reason = pcard->temp.reason;
pcard->current.reason = pcard->temp.reason; pcard->current.reason_effect = pcard->temp.reason_effect;
pcard->current.reason_effect = pcard->temp.reason_effect; pcard->current.reason_player = pcard->temp.reason_player;
pcard->current.reason_player = pcard->temp.reason_player; pcard->set_status(STATUS_DESTROY_CONFIRMED, FALSE);
pcard->set_status(STATUS_DESTROY_CONFIRMED, FALSE); targets->container.erase(pcard);
targets->container.erase(pcard); continue;
continue;
}
} }
eset.clear(); eset.clear();
pcard->filter_effect(EFFECT_INDESTRUCTABLE, &eset); pcard->filter_effect(EFFECT_INDESTRUCTABLE, &eset);
...@@ -3774,6 +3776,18 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -3774,6 +3776,18 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
uint8 playerid = pcard->sendto_param.playerid & 0x7; uint8 playerid = pcard->sendto_param.playerid & 0x7;
uint8 dest = pcard->sendto_param.location; uint8 dest = pcard->sendto_param.location;
uint8 seq = pcard->sendto_param.sequence; uint8 seq = pcard->sendto_param.sequence;
uint8 control_player = pcard->overlay_target ? pcard->overlay_target->current.controler : pcard->current.controler;
if(dest == LOCATION_GRAVE) {
core.hint_timing[control_player] |= TIMING_TOGRAVE;
} else if(dest == LOCATION_HAND) {
pcard->set_status(STATUS_PROC_COMPLETE, FALSE);
core.hint_timing[control_player] |= TIMING_TOHAND;
} else if(dest == LOCATION_DECK) {
pcard->set_status(STATUS_PROC_COMPLETE, FALSE);
core.hint_timing[control_player] |= TIMING_TODECK;
} else if(dest == LOCATION_REMOVED) {
core.hint_timing[control_player] |= TIMING_REMOVE;
}
//call move_card() //call move_card()
if(pcard->current.controler != playerid || pcard->current.location != dest) { if(pcard->current.controler != playerid || pcard->current.location != dest) {
pduel->write_buffer8(MSG_MOVE); pduel->write_buffer8(MSG_MOVE);
...@@ -3788,17 +3802,6 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3 ...@@ -3788,17 +3802,6 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
pduel->write_buffer32(pcard->get_info_location()); pduel->write_buffer32(pcard->get_info_location());
pduel->write_buffer32(pcard->current.reason); pduel->write_buffer32(pcard->current.reason);
} }
if(dest == LOCATION_GRAVE) {
core.hint_timing[pcard->current.controler] |= TIMING_TOGRAVE;
} else if(dest == LOCATION_HAND) {
pcard->set_status(STATUS_PROC_COMPLETE, FALSE);
core.hint_timing[pcard->current.controler] |= TIMING_TOHAND;
} else if(dest == LOCATION_DECK) {
pcard->set_status(STATUS_PROC_COMPLETE, FALSE);
core.hint_timing[pcard->current.controler] |= TIMING_TODECK;
} else if(dest == LOCATION_REMOVED) {
core.hint_timing[pcard->current.controler] |= TIMING_REMOVE;
}
if((core.deck_reversed && pcard->current.location == LOCATION_DECK) || (pcard->current.position == POS_FACEUP_DEFENSE)) if((core.deck_reversed && pcard->current.location == LOCATION_DECK) || (pcard->current.position == POS_FACEUP_DEFENSE))
param->show_decktop[pcard->current.controler] = true; param->show_decktop[pcard->current.controler] = true;
pcard->set_status(STATUS_LEAVE_CONFIRMED, FALSE); pcard->set_status(STATUS_LEAVE_CONFIRMED, FALSE);
......
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