Skip to content

Commit 11e9039

Browse files
committed
Walk Through Walls - Don't reset the flag if Vivian is being used
1 parent 4199489 commit 11e9039

File tree

2 files changed

+36
-33
lines changed

2 files changed

+36
-33
lines changed

ttyd-tools/rel/include/ttyd/party.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ namespace ttyd::party {
66

77
enum class PartyMembers : uint8_t
88
{
9-
Goombella = 1,
10-
Koops,
11-
Bobbery,
12-
Yoshi,
13-
Flurrie,
14-
Vivian,
15-
MsMowz,
16-
Egg,
17-
Flavio,
18-
Punio,
19-
Frankly,
20-
Gus,
21-
GoombellaFollower,
22-
KoopsFollower,
23-
BobberyFollower,
24-
YoshiFollower,
25-
FlurrieFollower,
26-
VivianFollower,
27-
MsMowzFollower,
9+
kGoombella = 1,
10+
kKoops,
11+
kBobbery,
12+
kYoshi,
13+
kFlurrie,
14+
kVivian,
15+
kMsMowz,
16+
kEgg,
17+
kFlavio,
18+
kPunio,
19+
kFrankly,
20+
kGus,
21+
kGoombellaFollower,
22+
kKoopsFollower,
23+
kBobberyFollower,
24+
kYoshiFollower,
25+
kFlurrieFollower,
26+
kVivianFollower,
27+
kMsMowzFollower,
2828
};
2929

3030
extern "C" {

ttyd-tools/rel/source/codes.cpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -150,25 +150,28 @@ void Mod::performBattleChecks()
150150

151151
void walkThroughMostObjects()
152152
{
153-
if (!Cheat[WALK_THROUGH_WALLS].Active ||
154-
!checkButtonComboEveryFrame(Cheat[WALK_THROUGH_WALLS].ButtonCombo))
153+
if (Cheat[WALK_THROUGH_WALLS].Active &&
154+
checkButtonComboEveryFrame(Cheat[WALK_THROUGH_WALLS].ButtonCombo))
155155
{
156-
// Check to see if Mario's properties should be reset
157-
if (ResetMarioProperties)
156+
ResetMarioProperties = true;
157+
158+
// Set Mario's properties to be able to walk through most objects
159+
ttyd::mario::Player *player = ttyd::mario::marioGetPtr();
160+
player->flags1 |= (1 << 10); // Turn on the 10 bit
161+
}
162+
else if (ResetMarioProperties)
163+
{
164+
ResetMarioProperties = false;
165+
166+
// Don't reset the properties if Vivian is currently being used
167+
ttyd::mario::Player *player = ttyd::mario::marioGetPtr();
168+
const uint32_t UsingVivian = 28;
169+
170+
if (player->currentMotionId != UsingVivian)
158171
{
159-
ResetMarioProperties = false;
160-
161-
ttyd::mario::Player *player = ttyd::mario::marioGetPtr();
162172
player->flags1 &= ~(1 << 10); // Turn off the 10 bit
163173
}
164-
return;
165174
}
166-
167-
// Set Mario;s properties to be able to walk through most objects
168-
ResetMarioProperties = true;
169-
170-
ttyd::mario::Player *player = ttyd::mario::marioGetPtr();
171-
player->flags1 |= (1 << 10); // Turn on the 10 bit
172175
}
173176

174177
void saveMarioAndPartnerPositions()

0 commit comments

Comments
 (0)