Commit 6cfe285b authored by DailyShana's avatar DailyShana

fix ignorance of location count when activating spell/trap in deck by effect

parent 30674f14
...@@ -191,18 +191,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con ...@@ -191,18 +191,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
&& !pduel->game_field->get_cteffect(this, playerid, FALSE)) && !pduel->game_field->get_cteffect(this, playerid, FALSE))
return FALSE; return FALSE;
} }
// additional check for each location if(handler->current.location == LOCATION_SZONE) {
if(handler->current.location == LOCATION_HAND) {
if(handler->data.type & TYPE_MONSTER) {
if(!(handler->data.type & TYPE_PENDULUM))
return FALSE;
if(!pduel->game_field->is_location_useable(playerid, LOCATION_PZONE, 0)
&& !pduel->game_field->is_location_useable(playerid, LOCATION_PZONE, 1))
return FALSE;
} else if(!(handler->data.type & TYPE_FIELD)
&& pduel->game_field->get_useable_count(handler, playerid, LOCATION_SZONE, playerid, LOCATION_REASON_TOFIELD) <= 0)
return FALSE;
} else if(handler->current.location == LOCATION_SZONE) {
if(handler->is_position(POS_FACEUP)) if(handler->is_position(POS_FACEUP))
return FALSE; return FALSE;
if(handler->equiping_target) if(handler->equiping_target)
...@@ -211,6 +200,16 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con ...@@ -211,6 +200,16 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
if((handler->data.type & TYPE_SPELL) && (handler->data.type & TYPE_QUICKPLAY)) if((handler->data.type & TYPE_SPELL) && (handler->data.type & TYPE_QUICKPLAY))
return FALSE; return FALSE;
} }
} else {
if(handler->data.type & TYPE_MONSTER) {
if(!(handler->data.type & TYPE_PENDULUM))
return FALSE;
if(!pduel->game_field->is_location_useable(playerid, LOCATION_PZONE, 0)
&& !pduel->game_field->is_location_useable(playerid, LOCATION_PZONE, 1))
return FALSE;
} else if(!(handler->data.type & TYPE_FIELD)
&& pduel->game_field->get_useable_count(handler, playerid, LOCATION_SZONE, playerid, LOCATION_REASON_TOFIELD) <= 0)
return FALSE;
} }
// check activate in hand/in set turn // check activate in hand/in set turn
int32 ecode = 0; int32 ecode = 0;
......
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