Commit 5dd0f9f7 authored by VanillaSalt's avatar VanillaSalt

fix

avoid conflict of core.destroy_set
parent a026c151
...@@ -199,7 +199,6 @@ struct processor { ...@@ -199,7 +199,6 @@ struct processor {
card_set release_cards; card_set release_cards;
card_set release_cards_ex; card_set release_cards_ex;
card_set release_cards_ex_sum; card_set release_cards_ex_sum;
card_set destroy_set;
card_set battle_destroy_rep; card_set battle_destroy_rep;
card_set fusion_materials; card_set fusion_materials;
card_set synchro_materials; card_set synchro_materials;
......
...@@ -819,8 +819,8 @@ int32 field::remove_overlay_card(uint16 step, uint32 reason, card* pcard, uint8 ...@@ -819,8 +819,8 @@ int32 field::remove_overlay_card(uint16 step, uint32 reason, card* pcard, uint8
int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player, group* targets, uint8 playerid, uint16 reset_phase, uint8 reset_count) { int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player, group* targets, uint8 playerid, uint16 reset_phase, uint8 reset_count) {
switch(step) { switch(step) {
case 0: { case 0: {
core.destroy_set.clear(); card_set* destroy_set = new card_set;
core.operated_set.clear(); core.units.begin()->arg1 = (ptr)destroy_set;
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;
...@@ -845,7 +845,7 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player ...@@ -845,7 +845,7 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player
} }
int32 fcount = get_useable_count(playerid, LOCATION_MZONE, playerid, LOCATION_REASON_CONTROL); int32 fcount = get_useable_count(playerid, LOCATION_MZONE, playerid, LOCATION_REASON_CONTROL);
if(fcount <= 0) { if(fcount <= 0) {
core.destroy_set.swap(targets->container); destroy_set->swap(targets->container);
core.units.begin()->step = 5; core.units.begin()->step = 5;
return FALSE; return FALSE;
} }
...@@ -864,9 +864,10 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player ...@@ -864,9 +864,10 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player
return FALSE; return FALSE;
} }
case 1: { case 1: {
card_set* destroy_set = (card_set*)core.units.begin()->arg1;
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]];
core.destroy_set.insert(pcard); destroy_set->insert(pcard);
targets->container.erase(pcard); targets->container.erase(pcard);
} }
return FALSE; return FALSE;
...@@ -917,8 +918,10 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player ...@@ -917,8 +918,10 @@ int32 field::get_control(uint16 step, effect* reason_effect, uint8 reason_player
return FALSE; return FALSE;
} }
case 6: { case 6: {
if(core.destroy_set.size()) card_set* destroy_set = (card_set*)core.units.begin()->arg1;
destroy(&core.destroy_set, 0, REASON_RULE, PLAYER_NONE); if(destroy_set->size())
destroy(destroy_set, 0, REASON_RULE, PLAYER_NONE);
delete destroy_set;
return FALSE; return FALSE;
} }
case 7: { case 7: {
...@@ -998,8 +1001,8 @@ int32 field::swap_control(uint16 step, effect * reason_effect, uint8 reason_play ...@@ -998,8 +1001,8 @@ int32 field::swap_control(uint16 step, effect * reason_effect, uint8 reason_play
int32 field::control_adjust(uint16 step) { int32 field::control_adjust(uint16 step) {
switch(step) { switch(step) {
case 0: { case 0: {
core.destroy_set.clear(); card_set* destroy_set = new card_set;
core.operated_set.clear(); core.units.begin()->peffect = (effect*)destroy_set;
uint32 b0 = get_useable_count(0, LOCATION_MZONE, PLAYER_NONE, 0); uint32 b0 = get_useable_count(0, LOCATION_MZONE, PLAYER_NONE, 0);
uint32 b1 = get_useable_count(1, LOCATION_MZONE, PLAYER_NONE, 0); uint32 b1 = get_useable_count(1, LOCATION_MZONE, PLAYER_NONE, 0);
for(auto cit = core.control_adjust_set[0].begin(); cit != core.control_adjust_set[0].end(); ++cit) for(auto cit = core.control_adjust_set[0].begin(); cit != core.control_adjust_set[0].end(); ++cit)
...@@ -1009,8 +1012,7 @@ int32 field::control_adjust(uint16 step) { ...@@ -1009,8 +1012,7 @@ int32 field::control_adjust(uint16 step) {
if(core.control_adjust_set[0].size() > core.control_adjust_set[1].size()) { if(core.control_adjust_set[0].size() > core.control_adjust_set[1].size()) {
if(core.control_adjust_set[0].size() - core.control_adjust_set[1].size() > b1) { if(core.control_adjust_set[0].size() - core.control_adjust_set[1].size() > b1) {
if(core.control_adjust_set[1].size() == 0 && b1 == 0) { if(core.control_adjust_set[1].size() == 0 && b1 == 0) {
core.destroy_set = core.control_adjust_set[0]; destroy_set->swap(core.control_adjust_set[0]);
core.control_adjust_set[0].clear();
core.units.begin()->step = 4; core.units.begin()->step = 4;
} else { } else {
core.units.begin()->arg1 = 0; core.units.begin()->arg1 = 0;
...@@ -1029,8 +1031,7 @@ int32 field::control_adjust(uint16 step) { ...@@ -1029,8 +1031,7 @@ int32 field::control_adjust(uint16 step) {
} else if (core.control_adjust_set[0].size() < core.control_adjust_set[1].size()) { } else if (core.control_adjust_set[0].size() < core.control_adjust_set[1].size()) {
if(core.control_adjust_set[1].size() - core.control_adjust_set[0].size() > b0) { if(core.control_adjust_set[1].size() - core.control_adjust_set[0].size() > b0) {
if(core.control_adjust_set[0].size() == 0 && b0 == 0) { if(core.control_adjust_set[0].size() == 0 && b0 == 0) {
core.destroy_set = core.control_adjust_set[1]; destroy_set->swap(core.control_adjust_set[1]);
core.control_adjust_set[1].clear();
core.units.begin()->step = 4; core.units.begin()->step = 4;
} else { } else {
core.units.begin()->arg1 = 1; core.units.begin()->arg1 = 1;
...@@ -1051,10 +1052,11 @@ int32 field::control_adjust(uint16 step) { ...@@ -1051,10 +1052,11 @@ int32 field::control_adjust(uint16 step) {
return FALSE; return FALSE;
} }
case 1: { case 1: {
card_set* destroy_set = (card_set*)core.units.begin()->peffect;
int32 adjp = core.units.begin()->arg1; int32 adjp = core.units.begin()->arg1;
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]];
core.destroy_set.insert(pcard); destroy_set->insert(pcard);
core.control_adjust_set[adjp].erase(pcard); core.control_adjust_set[adjp].erase(pcard);
} }
return FALSE; return FALSE;
...@@ -1128,8 +1130,10 @@ int32 field::control_adjust(uint16 step) { ...@@ -1128,8 +1130,10 @@ int32 field::control_adjust(uint16 step) {
return FALSE; return FALSE;
} }
case 5: { case 5: {
if(core.destroy_set.size()) card_set* destroy_set = (card_set*)core.units.begin()->peffect;
destroy(&core.destroy_set, 0, REASON_RULE, PLAYER_NONE); if(destroy_set->size())
destroy(destroy_set, 0, REASON_RULE, PLAYER_NONE);
delete destroy_set;
return TRUE; return TRUE;
} }
} }
......
...@@ -5143,19 +5143,18 @@ int32 field::adjust_step(uint16 step) { ...@@ -5143,19 +5143,18 @@ int32 field::adjust_step(uint16 step) {
case 10: { case 10: {
//equip check //equip check
uint8 tp = infos.turn_player; uint8 tp = infos.turn_player;
card* pcard; card_set destroy_set;
core.destroy_set.clear();
for(uint8 p = 0; p < 2; ++p) { for(uint8 p = 0; p < 2; ++p) {
for(uint8 i = 0; i < 5; ++i) { for(uint8 i = 0; i < 5; ++i) {
pcard = player[tp].list_szone[i]; card* pcard = player[tp].list_szone[i];
if(pcard && pcard->equiping_target && !pcard->is_affected_by_effect(EFFECT_EQUIP_LIMIT, pcard->equiping_target)) if(pcard && pcard->equiping_target && !pcard->is_affected_by_effect(EFFECT_EQUIP_LIMIT, pcard->equiping_target))
core.destroy_set.insert(pcard); destroy_set.insert(pcard);
} }
tp = 1 - tp; tp = 1 - tp;
} }
if(core.destroy_set.size()) { if(destroy_set.size()) {
core.re_adjust = TRUE; core.re_adjust = TRUE;
destroy(&core.destroy_set, 0, REASON_RULE, PLAYER_NONE); destroy(&destroy_set, 0, REASON_RULE, PLAYER_NONE);
} }
return FALSE; return 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