Commit f05e302c authored by mercury233's avatar mercury233 Committed by GitHub

update (#188)

don't move cards in grave and removed when them activate effect or become target
parent 9b568145
...@@ -2837,15 +2837,11 @@ int32 scriptlib::duel_set_target_card(lua_State *L) { ...@@ -2837,15 +2837,11 @@ int32 scriptlib::duel_set_target_card(lua_State *L) {
} }
if(peffect->is_flag(EFFECT_FLAG_CARD_TARGET)) { if(peffect->is_flag(EFFECT_FLAG_CARD_TARGET)) {
if(pcard) { if(pcard) {
if(pcard->current.location & 0x30)
pduel->game_field->move_card(pcard->current.controler, pcard, pcard->current.location, 0);
pduel->write_buffer8(MSG_BECOME_TARGET); pduel->write_buffer8(MSG_BECOME_TARGET);
pduel->write_buffer8(1); pduel->write_buffer8(1);
pduel->write_buffer32(pcard->get_info_location()); pduel->write_buffer32(pcard->get_info_location());
} else { } else {
for(auto& pcard : pgroup->container) { for(auto& pcard : pgroup->container) {
if(pcard->current.location & 0x30)
pduel->game_field->move_card(pcard->current.controler, pcard, pcard->current.location, 0);
pduel->write_buffer8(MSG_BECOME_TARGET); pduel->write_buffer8(MSG_BECOME_TARGET);
pduel->write_buffer8(1); pduel->write_buffer8(1);
pduel->write_buffer32(pcard->get_info_location()); pduel->write_buffer32(pcard->get_info_location());
......
...@@ -76,8 +76,6 @@ void field::change_target(uint8 chaincount, group* targets) { ...@@ -76,8 +76,6 @@ void field::change_target(uint8 chaincount, group* targets) {
pcard->create_relation(core.current_chain[chaincount - 1]); pcard->create_relation(core.current_chain[chaincount - 1]);
if(te->is_flag(EFFECT_FLAG_CARD_TARGET)) { if(te->is_flag(EFFECT_FLAG_CARD_TARGET)) {
for(auto& pcard : ot->container) { for(auto& pcard : ot->container) {
if(pcard->current.location & 0x30)
move_card(pcard->current.controler, pcard, pcard->current.location, 0);
pduel->write_buffer8(MSG_BECOME_TARGET); pduel->write_buffer8(MSG_BECOME_TARGET);
pduel->write_buffer8(1); pduel->write_buffer8(1);
pduel->write_buffer32(pcard->get_info_location()); pduel->write_buffer32(pcard->get_info_location());
......
...@@ -771,8 +771,6 @@ int32 field::process() { ...@@ -771,8 +771,6 @@ int32 field::process() {
if((returns.bvalue[0] > 0) && peffect->is_flag(EFFECT_FLAG_CARD_TARGET)) { if((returns.bvalue[0] > 0) && peffect->is_flag(EFFECT_FLAG_CARD_TARGET)) {
for(int32 i = 0; i < returns.bvalue[0]; ++i) { for(int32 i = 0; i < returns.bvalue[0]; ++i) {
card* pcard = core.select_cards[returns.bvalue[i + 1]]; card* pcard = core.select_cards[returns.bvalue[i + 1]];
if(pcard->current.location & 0x30)
move_card(pcard->current.controler, pcard, pcard->current.location, 0);
pduel->write_buffer8(MSG_BECOME_TARGET); pduel->write_buffer8(MSG_BECOME_TARGET);
pduel->write_buffer8(1); pduel->write_buffer8(1);
pduel->write_buffer32(pcard->get_info_location()); pduel->write_buffer32(pcard->get_info_location());
...@@ -4246,8 +4244,6 @@ int32 field::add_chain(uint16 step) { ...@@ -4246,8 +4244,6 @@ int32 field::add_chain(uint16 step) {
change_position(phandler, 0, phandler->current.controler, POS_FACEUP, 0); change_position(phandler, 0, phandler->current.controler, POS_FACEUP, 0);
} }
} }
if(phandler->current.location & (LOCATION_GRAVE | LOCATION_REMOVED))
move_card(phandler->current.controler, phandler, phandler->current.location, 0);
return FALSE; return FALSE;
} }
case 1: { case 1: {
......
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