From 0d3061574c3e8e5830e18fa34846e01f218d953a Mon Sep 17 00:00:00 2001 From: Ariel A <24759293+aarant@users.noreply.github.com> Date: Thu, 9 Jun 2022 22:00:24 -0400 Subject: [PATCH] Made follower disappear when decorating. Decreased number of max sprite decorations to 13. --- src/decoration.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/decoration.c b/src/decoration.c index 6d95cfbdc3..9b29fdb01e 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -41,7 +41,7 @@ #define PLACE_DECORATION_SELECTOR_TAG 0xbe5 #define PLACE_DECORATION_PLAYER_TAG 0x008 -#define NUM_DECORATION_FLAGS (FLAG_DECORATION_14 - FLAG_DECORATION_1 + 1) +#define NUM_DECORATION_FLAGS (FLAG_DECORATION_13 - FLAG_DECORATION_1 + 1) #define tCursorX data[0] #define tCursorY data[1] @@ -1360,6 +1360,7 @@ static void Task_PlaceDecoration(u8 taskId) } break; case 1: + RemoveFollowingPokemon(); gPaletteFade.bufferTransferDisabled = TRUE; ConfigureCameraObjectForPlacingDecoration(&sPlaceDecorationGraphicsDataBuffer, gCurDecorationItems[gCurDecorationIndex]); SetUpDecorationShape(taskId); @@ -1615,6 +1616,14 @@ static bool8 CanPlaceDecoration(u8 taskId, const struct Decoration *decoration) } break; } + + // If sprite(like), check if there is an available object event slot for it + if (decoration->permission == DECORPERM_SPRITE) { + for (i = 0; i < NUM_DECORATION_FLAGS; i++) + if (FlagGet(FLAG_DECORATION_1 + i) == TRUE) + return TRUE; + return FALSE; + } return TRUE; } @@ -2316,6 +2325,7 @@ static void Task_ContinuePuttingAwayDecorations(u8 taskId) } break; case 1: + RemoveFollowingPokemon(); SetUpPuttingAwayDecorationPlayerAvatar(); FadeInFromBlack(); tState = 2;