Fixed follower behavior when seen by trainers.
This commit is contained in:
parent
676261a0e0
commit
9952a47a64
2 changed files with 3 additions and 11 deletions
|
@ -147,6 +147,7 @@ static void Task_FreezeObjectAndPlayer(u8 taskId)
|
||||||
void FreezeForApproachingTrainers(void)
|
void FreezeForApproachingTrainers(void)
|
||||||
{
|
{
|
||||||
u8 trainerObjectId1, trainerObjectId2, taskId;
|
u8 trainerObjectId1, trainerObjectId2, taskId;
|
||||||
|
struct ObjectEvent *followerObj = GetFollowerObject();
|
||||||
trainerObjectId1 = GetChosenApproachingTrainerObjectEventId(0);
|
trainerObjectId1 = GetChosenApproachingTrainerObjectEventId(0);
|
||||||
|
|
||||||
if (gNoOfApproachingTrainers == 2)
|
if (gNoOfApproachingTrainers == 2)
|
||||||
|
@ -184,6 +185,8 @@ void FreezeForApproachingTrainers(void)
|
||||||
gTasks[taskId].tObjectFrozen = TRUE;
|
gTasks[taskId].tObjectFrozen = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (followerObj) // Unfreeze follower so it can move behind player
|
||||||
|
UnfreezeObjectEvent(followerObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 IsFreezeObjectAndPlayerFinished(void)
|
bool8 IsFreezeObjectAndPlayerFinished(void)
|
||||||
|
|
|
@ -462,22 +462,11 @@ static bool8 TrainerSeeIdle(u8 taskId, struct Task *task, struct ObjectEvent *tr
|
||||||
static bool8 TrainerExclamationMark(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj)
|
static bool8 TrainerExclamationMark(u8 taskId, struct Task *task, struct ObjectEvent *trainerObj)
|
||||||
{
|
{
|
||||||
u8 direction;
|
u8 direction;
|
||||||
struct ObjectEvent *followerObj = GetFollowerObject();
|
|
||||||
|
|
||||||
ObjectEventGetLocalIdAndMap(trainerObj, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]);
|
ObjectEventGetLocalIdAndMap(trainerObj, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]);
|
||||||
FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON);
|
FieldEffectStart(FLDEFF_EXCLAMATION_MARK_ICON);
|
||||||
direction = GetFaceDirectionMovementAction(trainerObj->facingDirection);
|
direction = GetFaceDirectionMovementAction(trainerObj->facingDirection);
|
||||||
ObjectEventSetHeldMovement(trainerObj, direction);
|
ObjectEventSetHeldMovement(trainerObj, direction);
|
||||||
if (followerObj) {
|
|
||||||
struct ObjectEvent *playerObj = &gObjectEvents[gPlayerAvatar.objectEventId];
|
|
||||||
s16 x = playerObj->currentCoords.x;
|
|
||||||
s16 y = playerObj->currentCoords.y;
|
|
||||||
// Move back player's location by facing direction
|
|
||||||
MoveCoords(GetOppositeDirection(playerObj->facingDirection), &x, &y);
|
|
||||||
direction = GetDirectionToFace(followerObj->previousCoords.x, followerObj->previousCoords.y, x, y);
|
|
||||||
followerObj->singleMovementActive = FALSE;
|
|
||||||
ObjectEventSetHeldMovement(followerObj, GetWalkNormalMovementAction(direction));
|
|
||||||
}
|
|
||||||
task->tFuncId++;
|
task->tFuncId++;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue