Commit c49a463f authored by VanillaSalt's avatar VanillaSalt

update

parent 8687a6ab
......@@ -192,9 +192,10 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
if(handler->data.type & TYPE_MONSTER) {
if(!(handler->data.type & TYPE_PENDULUM))
return FALSE;
if(pduel->game_field->player[playerid].list_szone[6] && pduel->game_field->player[playerid].list_szone[7])
if(!pduel->game_field->is_location_useable(playerid, LOCATION_SZONE, 6)
&& !pduel->game_field->is_location_useable(playerid, LOCATION_SZONE, 7))
return FALSE;
} else if(!(handler->data.type & TYPE_FIELD)
} else if(!(handler->data.type & TYPE_FIELD)
&& pduel->game_field->get_useable_count(playerid, LOCATION_SZONE, playerid, LOCATION_REASON_TOFIELD) <= 0)
return FALSE;
} else if(handler->current.location == LOCATION_SZONE) {
......
......@@ -484,7 +484,7 @@ card* field::get_field_card(uint8 playerid, uint8 location, uint8 sequence) {
int32 field::is_location_useable(uint8 playerid, uint8 location, uint8 sequence) {
if (location != LOCATION_MZONE && location != LOCATION_SZONE)
return TRUE;
int32 flag = player[playerid].disabled_location | player[playerid].used_location;
uint32 flag = player[playerid].disabled_location | player[playerid].used_location;
if (location == LOCATION_MZONE && flag & (0x1u << sequence))
return FALSE;
if (location == LOCATION_SZONE && flag & (0x100u << sequence))
......@@ -506,8 +506,8 @@ int32 field::get_useable_count(uint8 playerid, uint8 location, uint8 uplayer, ui
if(uplayer < 2)
filter_player_effect(playerid, EFFECT_MAX_MZONE, &eset);
} else {
flag = (flag & 0x1f00) >> 8;
used_flag = (used_flag & 0x1f00) >> 8;
flag = (flag >> 8) & 0x1f;
used_flag = (used_flag >> 8) & 0x1f;
if(uplayer < 2)
filter_player_effect(playerid, EFFECT_MAX_SZONE, &eset);
}
......
......@@ -4821,9 +4821,15 @@ void field::adjust_all() {
void field::refresh_location_info_instant() {
effect_set eset;
uint32 value, p;
int32 dis1 = player[0].disabled_location | (player[1].disabled_location << 16);
uint32 dis1 = player[0].disabled_location | (player[1].disabled_location << 16);
player[0].disabled_location = 0;
player[1].disabled_location = 0;
if(core.duel_rule >= 4) {
uint32 loc = player[0].used_location;
player[0].disabled_location = ((loc & 0x100) << 6) | ((loc & 0x1000) << 3) | ((loc >> 6) & 0x100) | ((loc >> 3) & 0x1000);
loc = player[1].used_location;
player[1].disabled_location = ((loc & 0x100) << 6) | ((loc & 0x1000) << 3) | ((loc >> 6) & 0x100) | ((loc >> 3) & 0x1000);
}
filter_field_effect(EFFECT_DISABLE_FIELD, &eset);
for (int32 i = 0; i < eset.size(); ++i) {
value = eset[i]->get_value();
......@@ -4844,7 +4850,7 @@ void field::refresh_location_info_instant() {
value = eset[i]->get_value();
player[p].disabled_location |= (value >> 8) & 0x1f00;
}
int32 dis2 = player[0].disabled_location | (player[1].disabled_location << 16);
uint32 dis2 = player[0].disabled_location | (player[1].disabled_location << 16);
if(dis1 != dis2) {
pduel->write_buffer8(MSG_FIELD_DISABLED);
pduel->write_buffer32(dis2);
......@@ -4859,6 +4865,12 @@ int32 field::refresh_location_info(uint16 step) {
core.units.begin()->arg2 = player[0].disabled_location | (player[1].disabled_location << 16);
player[0].disabled_location = 0;
player[1].disabled_location = 0;
if(core.duel_rule >= 4) {
uint32 loc = player[0].used_location;
player[0].disabled_location = ((loc & 0x100) << 6) | ((loc & 0x1000) << 3) | ((loc >> 6) & 0x100) | ((loc >> 3) & 0x1000);
loc = player[1].used_location;
player[1].disabled_location = ((loc & 0x100) << 6) | ((loc & 0x1000) << 3) | ((loc >> 6) & 0x100) | ((loc >> 3) & 0x1000);
}
core.disfield_effects.clear();
core.extram_effects.clear();
core.extras_effects.clear();
......@@ -4974,7 +4986,7 @@ int32 field::refresh_location_info(uint16 step) {
core.units.begin()->peffect = peffect;
core.extras_effects.remove_item(0);
uint32 p = peffect->get_handler_player();
uint32 szone_flag = ((player[p].disabled_location | player[p].used_location) & 0x1f00) >> 8;
uint32 szone_flag = ((player[p].disabled_location | player[p].used_location) >> 8) & 0x1f;
if(szone_flag == 0x1f) {
core.units.begin()->step = 6;
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