[Bug Fix] Loading pets from database will make unique name to not overlap existing pets with same name in zone (#1933)

This commit is contained in:
Natedog2012 2022-01-18 16:43:58 -06:00 committed by GitHub
parent 28b1abe1a7
commit 176bfc8524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -273,6 +273,8 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
if (petname != nullptr) {
// Name was provided, use it.
strn0cpy(npc_type->name, petname, 64);
EntityList::RemoveNumbers(npc_type->name);
entity_list.MakeNameUnique(npc_type->name);
} else if (record.petnaming == 0) {
strcpy(npc_type->name, this->GetCleanName());
npc_type->name[25] = '\0';