mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[8111] Implemented support for implicit specify owner when initializing stats for summoned pets.
* Speedup of summoning pets (no need to seach owner by guid) * Fixed problem that summond pets from NPC had not initialized stats (pet was not in world in time of stat init thus owner was not found) Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
parent
06dcbce4ee
commit
aab121fcb2
4 changed files with 12 additions and 9 deletions
|
|
@ -798,16 +798,19 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Pet::InitStatsForLevel(uint32 petlevel)
|
||||
bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner)
|
||||
{
|
||||
CreatureInfo const *cinfo = GetCreatureInfo();
|
||||
assert(cinfo);
|
||||
|
||||
Unit* owner = GetOwner();
|
||||
if(!owner)
|
||||
{
|
||||
sLog.outError("attempt to summon pet (Entry %u) without owner! Attempt terminated.", cinfo->Entry);
|
||||
return false;
|
||||
owner = GetOwner();
|
||||
if(!owner)
|
||||
{
|
||||
sLog.outError("attempt to summon pet (Entry %u) without owner! Attempt terminated.", cinfo->Entry);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 creature_ID = (getPetType() == HUNTER_PET) ? 1 : cinfo->Entry;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue