diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-12-14 20:00:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-14 20:00:59 -0500 |
commit | 18a5feb413827ee5641e9a21e8e90ba0e9a90142 (patch) | |
tree | 5b486cd8f42cf734099c0e9a4a3aea37f33c30e6 /src/union_room.c | |
parent | 6dea3374d2277468828c71ef1fb083d85cdcd2ff (diff) | |
parent | f7a729df3079041d3cc462a44919150f4ebdf19f (diff) |
Merge pull request #1269 from GriffinRichards/bugfix
Use BUGFIX for some inline fixes
Diffstat (limited to 'src/union_room.c')
-rw-r--r-- | src/union_room.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/union_room.c b/src/union_room.c index 3e80ffe37..479792a7c 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -478,7 +478,11 @@ static void Task_TryBecomeLinkLeader(u8 taskId) // BUG: sPlayerActivityGroupSize was meant below, not gPlayerCurrActivity // This will be false for all but ACTIVITY_BATTLE_DOUBLE and ACTIVITY_DECLINE // All this changes is which of two texts gets printed + #ifdef BUGFIX + id = (GROUP_MAX(sPlayerActivityGroupSize) == 2) ? 0 : 1; + #else id = (GROUP_MAX(gPlayerCurrActivity) == 2) ? 1 : 0; + #endif if (PrintOnTextbox(&data->textState, sPlayerUnavailableTexts[id])) { data->playerCount = sub_8013398(data->field_0); @@ -1320,7 +1324,11 @@ static bool32 IsPartnerActivityAcceptable(u32 activity, u32 linkGroup) if (linkGroup == 0xFF) return TRUE; - if (linkGroup <= ARRAY_COUNT(sAcceptedActivityIds)) // UB: <= may access data outside the array + #ifdef UBFIX + if (linkGroup < ARRAY_COUNT(sAcceptedActivityIds)) + #else + if (linkGroup <= ARRAY_COUNT(sAcceptedActivityIds)) + #endif { const u8 *bytes = sAcceptedActivityIds[linkGroup]; |