Core/Pets: Clean up logic/codedesign slightly for XP/levelup-handling, and also fix a possible overflow in the pet level-tests
(Thanks to Vladimir for the discussion regarding the possible overflow!) --HG-- branch : trunk
This commit is contained in:
@@ -14852,7 +14852,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint8 level = (creatureTarget->getLevel() < (getLevel() - 5)) ? (getLevel() - 5) : creatureTarget->getLevel();
|
||||
uint8 level = creatureTarget->getLevel() + 5 < getLevel() ? (getLevel() - 5) : creatureTarget->getLevel();
|
||||
|
||||
InitTamedPet(pet, level, spell_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user