File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -2144,14 +2144,32 @@ void menuCheckButton()
2144
2144
}
2145
2145
2146
2146
#ifdef TTYD_US
2147
- uint32_t offset = 0x308 ;
2147
+ uint32_t HeldItemOffset = 0x308 ;
2148
+ uint32_t BadgeFlagOffsetStart = 0x2E0 ;
2148
2149
#elif defined TTYD_JP
2149
- uint32_t offset = 0x304 ;
2150
+ uint32_t HeldItemOffset = 0x304 ;
2151
+ uint32_t BadgeFlagOffsetStart = 0x2DC ;
2150
2152
#elif defined TTYD_EU
2151
- uint32_t offset = 0x30C ;
2153
+ uint32_t HeldItemOffset = 0x30C ;
2154
+ uint32_t BadgeFlagOffsetStart = 0x2E4 ;
2152
2155
#endif
2153
2156
2154
- *reinterpret_cast <uint32_t *>(ActorAddress + offset) = 0 ;
2157
+ // Clear the held item
2158
+ *reinterpret_cast <int32_t *>(ActorAddress + HeldItemOffset) = 0 ;
2159
+
2160
+ // Do not clear the equipped badges for Mario or the partners
2161
+ uint32_t CurrentActorId = *reinterpret_cast <uint32_t *>(ActorAddress + 0x8 );
2162
+ const uint32_t MarioId = 222 ;
2163
+ const uint32_t MowzId = 230 ;
2164
+
2165
+ if ((CurrentActorId >= MarioId) &&
2166
+ (CurrentActorId <= MowzId))
2167
+ {
2168
+ break ;
2169
+ }
2170
+
2171
+ // Clear all of the currently equipped badges
2172
+ clearMemory (reinterpret_cast <void *>(ActorAddress + BadgeFlagOffsetStart), 0x28 );
2155
2173
break ;
2156
2174
}
2157
2175
case CHANGE_ACTOR_STATUSES:
You can’t perform that action at this time.
0 commit comments