Bug fix: add proper elevation handling for npc followers (#6871)

This commit is contained in:
Bivurnum 2025-05-16 02:54:22 -05:00 committed by GitHub
parent 4d4dea1b38
commit ddff74e8f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);