Commit c4bc9cad authored by DailyShana's avatar DailyShana

fix Fluorohydride/ygopro#1817

parent 9b3dbc2c
...@@ -3450,8 +3450,12 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3450,8 +3450,12 @@ int32 field::process_battle_command(uint16 step) {
group* ng = pduel->new_group(); group* ng = pduel->new_group();
ng->container.swap(des); ng->container.swap(des);
ng->is_readonly = TRUE; ng->is_readonly = TRUE;
std::unordered_map<card*, uint32>* card_op_params = new std::unordered_map<card*, uint32>;
for(auto cit = ng->container.begin(); cit != ng->container.end(); ++cit)
card_op_params->insert(std::make_pair(*cit, (*cit)->operation_param));
add_process(PROCESSOR_DESTROY, 10, 0, ng, REASON_BATTLE, PLAYER_NONE); add_process(PROCESSOR_DESTROY, 10, 0, ng, REASON_BATTLE, PLAYER_NONE);
core.units.begin()->ptarget = ng; core.units.begin()->ptarget = ng;
core.units.begin()->ptr1 = card_op_params;
} }
return FALSE; return FALSE;
} }
...@@ -3500,11 +3504,15 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3500,11 +3504,15 @@ int32 field::process_battle_command(uint16 step) {
case 32: { case 32: {
group* des = core.units.begin()->ptarget; group* des = core.units.begin()->ptarget;
if(des) { if(des) {
auto card_op_params = (std::unordered_map<card*, uint32>*)core.units.begin()->ptr1;
for(auto cit = des->container.begin(); cit != des->container.end();) { for(auto cit = des->container.begin(); cit != des->container.end();) {
auto rm = cit++; auto rm = cit++;
(*rm)->operation_param = card_op_params->find((*rm))->second;
if((*rm)->current.location != LOCATION_MZONE || ((*rm)->fieldid_r != core.pre_field[0] && (*rm)->fieldid_r != core.pre_field[1])) if((*rm)->current.location != LOCATION_MZONE || ((*rm)->fieldid_r != core.pre_field[0] && (*rm)->fieldid_r != core.pre_field[1]))
des->container.erase(rm); des->container.erase(rm);
} }
delete card_op_params;
core.units.begin()->ptr1 = 0;
add_process(PROCESSOR_DESTROY, 3, 0, des, REASON_BATTLE, PLAYER_NONE); add_process(PROCESSOR_DESTROY, 3, 0, des, REASON_BATTLE, PLAYER_NONE);
} }
adjust_all(); adjust_all();
......
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