From 75faf9ac1a9b67879e24c68943d7f2cbf36b0309 Mon Sep 17 00:00:00 2001 From: Singe Horizontal <62802903+Singe-Horizontal@users.noreply.github.com> Date: Sun, 4 Jun 2023 04:56:04 +0200 Subject: [PATCH] Fixes npc last path caching (#7769) Fixes #7766 --- src/map/npc.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 2514da97da..e9c3895820 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -99,7 +99,6 @@ static struct eri *timer_event_ers; //For the npc timer data. [Skotlex] /* hello */ static char *npc_last_path; -static char *npc_last_ref; struct npc_path_data { char* path; @@ -3471,7 +3470,6 @@ int npc_unload(struct npc_data* nd, bool single) { if (npd == npc_last_npd) { npc_last_npd = NULL; - npc_last_ref = NULL; npc_last_path = NULL; } } @@ -3706,10 +3704,9 @@ static void npc_parsename(struct npc_data* nd, const char* name, const char* sta npd->references++; npc_last_npd = npd; - npc_last_ref = npd->path; - npc_last_path = (char*) filepath; + npc_last_path = npd->path; } else { - nd->path = npc_last_ref; + nd->path = npc_last_path; if( npc_last_npd ) npc_last_npd->references++; }