Commit 39906673 authored by mercury233's avatar mercury233

fix Duel.SSet

parent 4f2b0cd2
...@@ -2352,7 +2352,7 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget ...@@ -2352,7 +2352,7 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
card_set* set_cards = new card_set; card_set* set_cards = new card_set;
core.operated_set.clear(); core.operated_set.clear();
for(auto& target : ptarget->container) { for(auto& target : ptarget->container) {
if((!(target->data.type & TYPE_FIELD) && get_useable_count(NULL, toplayer, LOCATION_SZONE, setplayer, LOCATION_REASON_TOFIELD) <= 0) if((!(target->data.type & TYPE_FIELD) && get_useable_count(target, toplayer, LOCATION_SZONE, setplayer, LOCATION_REASON_TOFIELD) <= 0)
|| (target->data.type & TYPE_MONSTER && !target->is_affected_by_effect(EFFECT_MONSTER_SSET)) || (target->data.type & TYPE_MONSTER && !target->is_affected_by_effect(EFFECT_MONSTER_SSET))
|| (target->current.location == LOCATION_SZONE) || (target->current.location == LOCATION_SZONE)
|| (!is_player_can_sset(setplayer, target)) || (!is_player_can_sset(setplayer, target))
...@@ -2387,16 +2387,12 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget ...@@ -2387,16 +2387,12 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
case 1: { case 1: {
card_set* set_cards = (card_set*)ptarget; card_set* set_cards = (card_set*)ptarget;
card* target = *set_cards->begin(); card* target = *set_cards->begin();
uint32 flag;
int32 ct = get_useable_count(target, toplayer, LOCATION_SZONE, setplayer, LOCATION_REASON_TOFIELD, 0xff, &flag);
if(ct <= 0) {
core.units.begin()->step = 2;
return FALSE;
}
if(target->data.type & TYPE_FIELD) { if(target->data.type & TYPE_FIELD) {
returns.bvalue[2] = 5; returns.bvalue[2] = 5;
return FALSE; return FALSE;
} }
uint32 flag;
get_useable_count(target, toplayer, LOCATION_SZONE, setplayer, LOCATION_REASON_TOFIELD, 0xff, &flag);
flag |= core.set_group_used_zones; flag |= core.set_group_used_zones;
if(setplayer == toplayer) { if(setplayer == toplayer) {
flag = ((flag & 0xff) << 8) | 0xffff00ff; flag = ((flag & 0xff) << 8) | 0xffff00ff;
......
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