From 598f5dd9140b90c5bd2d61941a2e24f2c6771646 Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 28 Jun 2020 17:22:59 -0600 Subject: [PATCH] cherry pick 8960588d0b0b9e31c8971173396f6e631930229b --- data/layouts/PetalburgCity/map.bin | Bin 1800 -> 1800 bytes src/event_object_movement.c | 18 +++++------------- src/field_control_avatar.c | 11 ++--------- src/field_effect_helpers.c | 2 +- src/field_player_avatar.c | 5 ----- 5 files changed, 8 insertions(+), 28 deletions(-) diff --git a/data/layouts/PetalburgCity/map.bin b/data/layouts/PetalburgCity/map.bin index 35f0172ca20a07e800bc248b803e740364a24715..46c808e0556b1a035ea9cc16f5e47fc0a64f20f5 100644 GIT binary patch delta 229 zcmeC+>)_k)fQcuACDQ={vsfliU=f+bEG5WjFoUVk0Rks5F&ZdL)@Ih`V>Flv7oEs7 zIfYpdC^U;Hn!!h%wkB9_T_m^DN$3M>@ZCBSF^k~q(B zo&hW&!2;4=zyh=>p)g?r6Hsjki=Mz-qZv#)Bs^E$W{(k1D*<&N+_&ine4)v!+3G?M%Hjf05ujtS^xk5 delta 232 zcmeC+>)_k)fQeVq5CIh@Z)6gl#4IHkWE5Tc zp%4~5o@b`dO%+%aS%g`XSSBYhiA-L^BF6)^(+Fboscript; - else - return GetFollowerScriptPointer(); + return GetObjectEventTemplateByLocalIdAndMap(localId, mapNum, mapGroup)->script; } const u8 *GetObjectEventScriptPointerByObjectEventId(u8 objectEventId) @@ -5029,7 +5024,7 @@ static bool8 DoesObjectCollideWithObjectAt(struct ObjectEvent *objectEvent, s16 for (i = 0; i < OBJECT_EVENTS_COUNT; i++) { curObject = &gObjectEvents[i]; - if (curObject->active && curObject != objectEvent && !FollowMe_IsCollisionExempt(curObject, objectEvent)) + if (curObject->active && curObject != objectEvent) { // check for collision if curObject is active, not the object in question, and not exempt from collisions if ((curObject->currentCoords.x == x && curObject->currentCoords.y == y) || (curObject->previousCoords.x == x && curObject->previousCoords.y == y)) @@ -5185,9 +5180,6 @@ bool8 ObjectEventSetHeldMovement(struct ObjectEvent *objectEvent, u8 movementAct objectEvent->heldMovementActive = TRUE; objectEvent->heldMovementFinished = FALSE; gSprites[objectEvent->spriteId].data[2] = 0; - - FollowMe(objectEvent, movementActionId, FALSE); - return FALSE; } diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index f0a7f708f..9c24ee77e 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -28,7 +28,6 @@ #include "trainer_see.h" #include "trainer_hill.h" #include "wild_encounter.h" -#include "follow_me.h" #include "constants/event_bg.h" #include "constants/event_objects.h" #include "constants/field_poison.h" @@ -480,10 +479,10 @@ static const u8 *GetInteractedMetatileScript(struct MapPosition *position, u8 me static const u8 *GetInteractedWaterScript(struct MapPosition *unused1, u8 metatileBehavior, u8 direction) { - if (FlagGet(FLAG_BADGE05_GET) == TRUE && PartyHasMonWithSurf() == TRUE && IsPlayerFacingSurfableFishableWater() == TRUE && CheckFollowerFlag(FOLLOWER_FLAG_CAN_SURF)) + if (FlagGet(FLAG_BADGE05_GET) == TRUE && PartyHasMonWithSurf() == TRUE && IsPlayerFacingSurfableFishableWater() == TRUE) return EventScript_UseSurf; - if (MetatileBehavior_IsWaterfall(metatileBehavior) == TRUE && CheckFollowerFlag(FOLLOWER_FLAG_CAN_WATERFALL)) + if (MetatileBehavior_IsWaterfall(metatileBehavior) == TRUE) { if (FlagGet(FLAG_BADGE08_GET) == TRUE && IsPlayerSurfingNorth() == TRUE) return EventScript_UseWaterfall; @@ -495,9 +494,6 @@ static const u8 *GetInteractedWaterScript(struct MapPosition *unused1, u8 metati static bool32 TrySetupDiveDownScript(void) { - if (!CheckFollowerFlag(FOLLOWER_FLAG_CAN_DIVE)) - return FALSE; - if (FlagGet(FLAG_BADGE07_GET) && TrySetDiveWarp() == 2) { ScriptContext1_SetupScript(EventScript_UseDive); @@ -508,9 +504,6 @@ static bool32 TrySetupDiveDownScript(void) static bool32 TrySetupDiveEmergeScript(void) { - if (!CheckFollowerFlag(FOLLOWER_FLAG_CAN_DIVE)) - return FALSE; - if (FlagGet(FLAG_BADGE07_GET) && gMapHeader.mapType == MAP_TYPE_UNDERWATER && TrySetDiveWarp() == 1) { ScriptContext1_SetupScript(EventScript_UseDiveUnderwater); diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index 67102a83b..e8e3dd6fe 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -1081,7 +1081,7 @@ static void CreateBobbingEffect(struct ObjectEvent *objectEvent, struct Sprite * } } -u8 sub_8155800(u8 oldSpriteId) +u8 DoBobbingFieldEffect(u8 oldSpriteId) { u8 spriteId; struct Sprite *sprite; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index f74b4f5a9..2d70fd2b1 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -20,7 +20,6 @@ #include "strings.h" #include "task.h" #include "tv.h" -#include "follow_me.h" #include "wild_encounter.h" #include "constants/abilities.h" #include "constants/event_objects.h" @@ -1425,8 +1424,6 @@ void InitPlayerAvatar(s16 x, s16 y, u8 direction, u8 gender) gPlayerAvatar.spriteId = objectEvent->spriteId; gPlayerAvatar.gender = gender; SetPlayerAvatarStateMask(PLAYER_AVATAR_FLAG_5 | PLAYER_AVATAR_FLAG_ON_FOOT); - - CreateFollowerAvatar(); } void SetPlayerInvisibility(bool8 invisible) @@ -1672,8 +1669,6 @@ static void CreateStopSurfingTask(u8 direction) taskId = CreateTask(Task_StopSurfingInit, 0xFF); gTasks[taskId].data[0] = direction; Task_StopSurfingInit(taskId); - - PrepareFollowerDismountSurf(); } static void Task_StopSurfingInit(u8 taskId)