Bug fix: add proper elevation handling for npc followers (#6871)
This commit is contained in:
parent
4d4dea1b38
commit
ddff74e8f9
@ -9826,11 +9826,11 @@ static void UpdateObjectEventElevationAndPriority(struct ObjectEvent *objEvent,
|
||||
return;
|
||||
|
||||
ObjectEventUpdateElevation(objEvent, sprite);
|
||||
if (objEvent->localId == OBJ_EVENT_ID_FOLLOWER)
|
||||
if (objEvent->localId == OBJ_EVENT_ID_FOLLOWER || objEvent->localId == OBJ_EVENT_ID_NPC_FOLLOWER)
|
||||
{
|
||||
// keep subspriteMode synced with player's
|
||||
// so that it disappears under bridges when they do
|
||||
if (OW_LARGE_OW_SUPPORT)
|
||||
if (OW_LARGE_OW_SUPPORT && objEvent->localId == OBJ_EVENT_ID_FOLLOWER)
|
||||
sprite->subspriteMode |= gSprites[gPlayerAvatar.spriteId].subspriteMode & SUBSPRITES_IGNORE_PRIORITY;
|
||||
// if transitioning between elevations, use the player's elevation
|
||||
if (!objEvent->currentElevation)
|
||||
@ -9889,7 +9889,7 @@ static void ObjectEventUpdateSubpriority(struct ObjectEvent *objEvent, struct Sp
|
||||
return;
|
||||
|
||||
// If transitioning between elevations, use the player's elevation
|
||||
if (!objEvent->currentElevation && objEvent->localId == OBJ_EVENT_ID_FOLLOWER)
|
||||
if (!objEvent->currentElevation && (objEvent->localId == OBJ_EVENT_ID_FOLLOWER || objEvent->localId == OBJ_EVENT_ID_NPC_FOLLOWER))
|
||||
objEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
|
||||
SetObjectSubpriorityByElevation(objEvent->previousElevation, sprite, 1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user