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:
click
2010-12-17 20:08:27 +01:00
parent e867481ccb
commit 0785ad465b
2 changed files with 20 additions and 21 deletions
+1 -1
View File
@@ -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);