Fluorohydride / ygopro-core

ygopro script engine.
MIT License
321 stars 135 forks source link

keep last active_type until the next activate #615

Closed mercury233 closed 1 month ago

mercury233 commented 1 month ago

Problem: In the condition of EVENT_CHAINING effects, the script may need to check re:IsActiveType. If the re handler change its type in chain (Centur-Ion Trudea), re:IsActiveType should return the type when re was activating. We set and return active_type to solve this problem. But if EVENT_CHAINING effect check re:IsActiveType after the chain solve (EFFECT_FLAG_ACTIVATE_CONDITION, Kashtira Preparations), the active_type will be reset at that time.

Solution: Don't reset. Generally effect::get_active_type won't be used outside EVENT_CHAINING.