Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EFFECT_TYPE_XMATERIAL crash #353

Open
edo9300 opened this issue Jan 13, 2021 · 0 comments
Open

EFFECT_TYPE_XMATERIAL crash #353

edo9300 opened this issue Jan 13, 2021 · 0 comments

Comments

@edo9300
Copy link
Contributor

edo9300 commented Jan 13, 2021

As title says, the core will crash if a card uses the same granted effect twice in the same chain, but the material giving it is no longer attached to the xyz monster. The crash happens when resolving the the effect the second time, and the crash happens because by that time

ygopro-core/processor.cpp

Lines 4280 to 4283 in 225a846

pduel->write_buffer8(MSG_CHAIN_SOLVING);
pduel->write_buffer8(cait->chain_count);
add_to_disable_check_list(cait->triggering_effect->get_handler());
adjust_instant();

the call to get_handler will return nullptr, as the effect will no longer have an active_handler registered.
Reproducible with this puzzle.
A similar crash, still caused by the handling of such effects, can occur with cards like Altergeist Multifaker, that use EVENT_CHAINING/EVENT_CHAIN_SOLVED to check the reason effect, by teh time the condition is called, if the xyz monster detached the material giving the effect, re will cause the same crashing behaviour if a function accessing the handler is called. (in the case of multifaker, calling IsActiveType before IsHasType will crash the game, as IsActiveType checks the handler, whereas the other doesn't.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant