From b07fb501285b9e3f7141dcdea1e9d7857c3ace21 Mon Sep 17 00:00:00 2001 From: matthewdavidrichardanderson Date: Sun, 14 Jun 2026 06:39:30 +0200 Subject: [PATCH] monkey crash fix (#2034) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * monkey fix 🐒 * wrap saru_p clear in target_pc * Clear monkey leader pointer on delete --------- Co-authored-by: matthewdavidrichardanderson Co-authored-by: Luke Street --- src/d/actor/d_a_npc_ks.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/d/actor/d_a_npc_ks.cpp b/src/d/actor/d_a_npc_ks.cpp index 71eeb16335..222827df63 100644 --- a/src/d/actor/d_a_npc_ks.cpp +++ b/src/d/actor/d_a_npc_ks.cpp @@ -6882,6 +6882,16 @@ static int daNpc_Ks_Delete(npc_ks_class* i_this) { i_this->model->stopZelAnime(); } +#if TARGET_PC + if (leader == i_this) { + leader = NULL; + } + + if (saru_p[i_this->set_id] == i_this) { + saru_p[i_this->set_id] = NULL; + } +#endif + return 1; }