removeobject and removeobjectat macros work properly with npc followers (#6889)

This commit is contained in:
Bivurnum 2025-05-26 16:40:00 -05:00 committed by GitHub
parent 983f8e34a1
commit a967f36091
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1022,6 +1022,13 @@ void NPCFollow(struct ObjectEvent *npc, u32 state, bool32 ignoreScriptActive)
else if (ArePlayerFieldControlsLocked() && !ignoreScriptActive)
return;
// If the follower's object has been removed, create a new one and set it to reappear.
if (!follower->active)
{
CreateFollowerNPCAvatar();
SetFollowerNPCData(FNPC_DATA_WARP_END, FNPC_WARP_REAPPEAR);
}
// Restore post warp behavior after setobjectxy.
if (GetFollowerNPCData(FNPC_DATA_COME_OUT_DOOR) == FNPC_DOOR_NO_POS_SET)
SetFollowerNPCData(FNPC_DATA_COME_OUT_DOOR, FNPC_DOOR_NONE);