Core/Pets: Use the safer pet level check-method in SynchronizeLevelWithOwner() too (forgotten in previous commit)
--HG-- branch : trunk
This commit is contained in:
@@ -1985,17 +1985,9 @@ void Pet::SynchronizeLevelWithOwner()
|
|||||||
// can't be greater owner level
|
// can't be greater owner level
|
||||||
case HUNTER_PET:
|
case HUNTER_PET:
|
||||||
if (getLevel() > owner->getLevel())
|
if (getLevel() > owner->getLevel())
|
||||||
{
|
|
||||||
GivePetLevel(owner->getLevel());
|
GivePetLevel(owner->getLevel());
|
||||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(owner->getLevel())/5);
|
else if (getLevel() + 5 < owner->getLevel())
|
||||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
GivePetLevel(owner->getLevel() - 5);
|
||||||
}
|
|
||||||
if (getLevel() < owner->getLevel()-5)
|
|
||||||
{
|
|
||||||
GivePetLevel(owner->getLevel()-5);
|
|
||||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(owner->getLevel()-5)/5);
|
|
||||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user