mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 19:51:29 +00:00
SetPetID after we assign the new NPC an ID (#1851)
This commit is contained in:
parent
7cac2e2bc3
commit
f70b4a79b2
@ -689,6 +689,14 @@ void EntityList::AddNPC(NPC *npc, bool SendSpawnPacket, bool dontqueue)
|
|||||||
{
|
{
|
||||||
npc->SetID(GetFreeID());
|
npc->SetID(GetFreeID());
|
||||||
|
|
||||||
|
//If this is not set here we will despawn pets from new AC changes
|
||||||
|
auto owner_id = npc->GetOwnerID();
|
||||||
|
if(owner_id) {
|
||||||
|
auto owner = entity_list.GetMob(owner_id);
|
||||||
|
if (owner) {
|
||||||
|
owner->SetPetID(npc->GetID());
|
||||||
|
}
|
||||||
|
}
|
||||||
parse->EventNPC(EVENT_SPAWN, npc, nullptr, "", 0);
|
parse->EventNPC(EVENT_SPAWN, npc, nullptr, "", 0);
|
||||||
|
|
||||||
uint16 emoteid = npc->GetEmoteID();
|
uint16 emoteid = npc->GetEmoteID();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user