From a967f360919064945079f447d4bfe346efe7b263 Mon Sep 17 00:00:00 2001 From: Bivurnum <147376167+Bivurnum@users.noreply.github.com> Date: Mon, 26 May 2025 16:40:00 -0500 Subject: [PATCH] `removeobject` and `removeobjectat` macros work properly with npc followers (#6889) --- src/follower_npc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/follower_npc.c b/src/follower_npc.c index 47a2a94372..870668a9d5 100644 --- a/src/follower_npc.c +++ b/src/follower_npc.c @@ -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);