From b257a28fa9a9177df32845db8171d376bd6d4404 Mon Sep 17 00:00:00 2001 From: maximius Date: Sun, 1 Nov 2009 17:53:07 -0800 Subject: *Cleanup, fix many cases of unoptimized loops, potential crashes, excessively large data types, unnecessary or wrong casts, non-standardized function calls, and so on.. *Proper Maexxna Web Spray locations (old locations sent players flying into the air) --HG-- branch : trunk --- src/game/Creature.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/game/Creature.cpp') diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index dbfe024f371..39921239678 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1390,9 +1390,9 @@ void Creature::SelectLevel(const CreatureInfo *cinfo) uint32 rank = isPet()? 0 : cinfo->rank; // level - uint32 minlevel = std::min(cinfo->maxlevel, cinfo->minlevel); - uint32 maxlevel = std::max(cinfo->maxlevel, cinfo->minlevel); - uint32 level = minlevel == maxlevel ? minlevel : urand(minlevel, maxlevel); + uint8 minlevel = std::min(cinfo->maxlevel, cinfo->minlevel); + uint8 maxlevel = std::max(cinfo->maxlevel, cinfo->minlevel); + uint8 level = minlevel == maxlevel ? minlevel : urand(minlevel, maxlevel); SetLevel(level); float rellevel = maxlevel == minlevel ? 0 : (float(level - minlevel))/(maxlevel - minlevel); @@ -2510,12 +2510,12 @@ void Creature::AllLootRemovedFromCorpse() } } -uint32 Creature::getLevelForTarget( Unit const* target ) const +uint8 Creature::getLevelForTarget(Unit const* target) const { if(!isWorldBoss()) return Unit::getLevelForTarget(target); - uint32 level = target->getLevel()+sWorld.getConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF); + uint16 level = target->getLevel()+sWorld.getConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF); if(level < 1) return 1; if(level > 255) -- cgit v1.2.3