Core/Pets: Use the safer pet level check-method in SynchronizeLevelWithOwner() too (forgotten in previous commit)

--HG--
branch : trunk
This commit is contained in:
click
2010-12-17 20:27:36 +01:00
parent 0785ad465b
commit 97f912fe93
+2 -10
View File
@@ -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;