Commit b47613b6 authored by salix5's avatar salix5

fix EFFECT_DISABLE_FIELD

EFFECT_DISABLE_FIELD has 3 types:
1. The player chooses the location
The script has an operation function but no value function.
The temp value will be set in operation, and it will be reset in card::reset().

2. Certain location related to the card
The script has a value function.
It will not be reset in card::reset().

3. Fixed location
The script sets the value as a constant.
The temp value will be reset in card::reset().
parent b7d28b65
......@@ -1899,8 +1899,10 @@ void card::reset(uint32 id, uint32 reset_type) {
battled_cards.clear();
reset_effect_count();
auto pr = field_effect.equal_range(EFFECT_DISABLE_FIELD);
for(; pr.first != pr.second; ++pr.first)
pr.first->second->value = 0;
for(; pr.first != pr.second; ++pr.first){
if(!pr.first->second->is_flag(EFFECT_FLAG_FUNC_VALUE))
pr.first->second->value = 0;
}
}
if(id & (RESET_TODECK | RESET_TOHAND | RESET_TOGRAVE | RESET_REMOVE | RESET_TEMP_REMOVE
| RESET_OVERLAY | RESET_MSCHANGE | RESET_TOFIELD | RESET_TURN_SET)) {
......
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