mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/Pets: Initialize pet level properly (stupid mistake), and set loaded XP after initialization is completed.
--HG-- branch : trunk
This commit is contained in:
@@ -230,7 +230,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
|
||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped here
|
||||
SetCreatorGUID(owner->GetGUID());
|
||||
|
||||
SetLevel(petlevel);
|
||||
InitStatsForLevel(petlevel);
|
||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, fields[5].GetUInt32());
|
||||
|
||||
SynchronizeLevelWithOwner();
|
||||
@@ -239,10 +239,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
|
||||
SetCanModifyStats(true);
|
||||
|
||||
if (getPetType() == SUMMON_PET && !current) //all (?) summon pets come with full health when called, but not when they are current
|
||||
{
|
||||
InitStatsForLevel(petlevel);
|
||||
SetPower(POWER_MANA, GetMaxPower(POWER_MANA));
|
||||
}
|
||||
else
|
||||
{
|
||||
uint32 savedhealth = fields[10].GetUInt32();
|
||||
|
||||
Reference in New Issue
Block a user