[Bots] Prevent bot pets from despawning on #repop (#4790)

This commit is contained in:
nytmyr 2025-03-29 14:29:29 -05:00 committed by GitHub
parent 937b947597
commit 5e4fd43920
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}
}