aboutsummaryrefslogtreecommitdiff
path: root/src/game/Creature.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-11-01 17:53:07 -0800
committermaximius <none@none>2009-11-01 17:53:07 -0800
commitb257a28fa9a9177df32845db8171d376bd6d4404 (patch)
treed1093029c66fc36a705aa0f344ba3a4fb77e36d5 /src/game/Creature.cpp
parent2b2b2a1d0ec0e8942b27047f6706f29775a00eb8 (diff)
*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
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r--src/game/Creature.cpp10
1 files changed, 5 insertions, 5 deletions
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)