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

fixed bug giving immunity to full-paralysis when B_MAGIC_GUARD is >= GEN_4 #6032

Merged
merged 5 commits into from
Jan 18, 2025

Conversation

AERDU
Copy link

@AERDU AERDU commented Jan 15, 2025

Description

This should fix a bug reproducible by setting B_MAGIC_GUARD to GEN_3 or lower.

My approach isn't ideal as RNG_PARALYSIS will now needlessly roll, but I wrote this fix for personal use and figured it couldn't hurt.

Feel free to test.

disc

47929991024

This should fix a bug reproducible by setting `B_MAGIC_GUARD` to `GEN_3` or lower. I'm pretty sure the previous logic made it so, if your ability is NOT magic guard, you get full-paralysis immunity.

My approach isn't ideal as `RNG_PARALYSIS` will now needlessly roll, but I wrote this fix for personal use and figured it couldn't hurt.
@AlexOn1ine
Copy link
Collaborator

what was the bug?

@AERDU
Copy link
Author

AERDU commented Jan 16, 2025

You know how you can get immobilized by paralysis? If you have B_MAGIC_GUARD set to a generation where magic guard doesn't grant immunity to immobilization(GEN_3), you will never get immobilized by paralysis, no matter which ability you have.

Shouldn't be much harder than that to replicate the bug, I tried it on a clean build.

@AlexOn1ine
Copy link
Collaborator

AlexOn1ine commented Jan 16, 2025

To avoid running the random calls you can just replace the previous line with

!(B_MAGIC_GUARD >= GEN_4 && GetBattlerAbility(gBattlerAttacker) == ABILITY_MAGIC_GUARD)

@AERDU
Copy link
Author

AERDU commented Jan 17, 2025

updated, should I do #5990 while I'm at it?

@AlexOn1ine
Copy link
Collaborator

updated, should I do #5990 while I'm at it?

ye, that would be nice

@AERDU
Copy link
Author

AERDU commented Jan 17, 2025

I think that's all the references to B_MAGIC_GUARD.

@AlexOn1ine AlexOn1ine merged commit e4e4460 into rh-hideout:master Jan 18, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants