Fixed shallow water bug with followers

Before this fix, if the follower shrunk into its pokeball while standing on shallow water, the rippling effect would still be happening. This fixes that.
This commit is contained in:
W1serV1ser committed 2022-03-29 16:07:58 -07:00
1 parent 557e517bbb
commit 07310bdfe5
2 files changed
+10 -1

No files matched your search

+8
View File
@@ -10467,6 +10467,14 @@ u8 MovementAction_FollowingPokemon_Grow_Step1(struct ObjectEvent *objectEvent, s
}
FreeSpriteOamMatrix(sprite);
// Make sure water ripples at the feet of the follower if they are appearing on top of shallow water.
if (MetatileBehavior_IsShallowFlowingWater(MapGridGetMetatileBehaviorAt(objectEvent->currentCoords.x, objectEvent->currentCoords.y)))
{
objectEvent->inShallowFlowingWater = TRUE;
StartFieldEffectForObjectEvent(FLDEFF_FEET_IN_FLOWING_WATER, objectEvent);
}
sprite->data[2]++;
}
+2 -1
View File
@@ -820,7 +820,8 @@ static void UpdateFeetInFlowingWaterFieldEffect(struct Sprite *sprite)
struct Sprite *linkedSprite;
struct ObjectEvent *objectEvent;
if (TryGetObjectEventIdByLocalIdAndMap(sprite->data[0], sprite->data[1], sprite->data[2], &objectEventId) || !gObjectEvents[objectEventId].inShallowFlowingWater)
if (TryGetObjectEventIdByLocalIdAndMap(sprite->data[0], sprite->data[1], sprite->data[2], &objectEventId) || !gObjectEvents[objectEventId].inShallowFlowingWater
|| (gObjectEvents[objectEventId].invisible && objectEventId == gSaveBlock2Ptr->follower.objId && gSaveBlock2Ptr->follower.inProgress))
{
FieldEffectStop(sprite, FLDEFF_FEET_IN_FLOWING_WATER);
}