-
Notifications
You must be signed in to change notification settings - Fork 35
Update Trainer.cpp to allow the player to enter doors even if Ashley is trapped #632
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
base: master
Are you sure you want to change the base?
Conversation
dllmain/Trainer.cpp
Outdated
if (re4t::cfg->bTrainerAllowEnterDoorsWithoutAsh) | ||
{ | ||
GlobalPtr()->flags_STATUS_2_5024[0] &= ~0x20000000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlagSet(GlobalPtr()->flags_STATUS_0_501C, uint32_t(Flags_STATUS::STA_SUB_CATCHED), false);
might unset the same flag, haven't tested that though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea it does work. It's also equivalent to:
FlagSet(GlobalPtr()->flags_STATUS_2_5024, uint32_t(Flags_STATUS::STA_PL_CHECK2), false);
To be explicit about which flag would change. I will update the branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STA_SUB_CATCHED should be the right flag afaik:
STA_SUB_CATCHED = 66, // 0x20000000 (@ 0x8)
The @ 0x8 there says FlagSet will add 0x8 to the flag ptr flags_STATUS_0_501C
, so it'll be written to flags_STATUS_2_5024 instead (those flags_STATUS_X fields are really just a single array of ints that FlagSet accesses by flagIdx / 32
, not actually sure why we left them as separate fields in the struct though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was aware of that and debugged FlagSet for both statements, but I wasn't aware of the fact that those flags are meant to be elements of a flag array, even if both statements are equivalent it also dawned on me the name STA_SUB_CATCHED makes more sense, I suppose your FlagSet call makes a lot more sense but I should just add a comment to clarify which flag is modified since it's implicit
Disabling the flag with FlagSet
Hello, just wanted to check in if there is anything potentially missing or worth looking into, not sure this PR is of interest currently |
When the "Allow entering doors without Ashley" option is enabled, it doesn't account for Ashley triggering a trap and getting stuck. In such cases, the player would be unable to enter any doors. By disabling that flag (that is checked in CheckAshleyActive), it overrides that behavior, then the player can enter doors regardless.
Test cases:
I tested this in the game when it's raining after encountering Ashley and bringing her back, in the village where the church is located and many places around it, there are many traps (and doors)