From 5e4fd43920fdac325c7200f714a558a7d5acdb43 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Sat, 29 Mar 2025 14:29:29 -0500 Subject: [PATCH] [Bots] Prevent bot pets from despawning on #repop (#4790) --- zone/entity.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 1374c8f19..72209dee7 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -3143,20 +3143,23 @@ void EntityList::Depop(bool StartSpawnTimer) { for (auto it = npc_list.begin(); it != npc_list.end(); ++it) { NPC *pnpc = it->second; + if (pnpc) { Mob *own = pnpc->GetOwner(); - //do not depop player's pets... - if (own && own->IsClient()) + //do not depop player/bot pets... + if (own && own->IsOfClientBot()) { continue; + } - if (pnpc->IsHorse()) + if (pnpc->IsHorse()) { continue; + } - if (pnpc->IsFindable()) + if (pnpc->IsFindable()) { UpdateFindableNPCState(pnpc, true); + } pnpc->WipeHateList(); - pnpc->Depop(StartSpawnTimer); } }