Core/Game: fix all warnings related to converting doubles and floats.

--HG--
branch : trunk
This commit is contained in:
silinoron
2010-08-22 12:39:39 -07:00
parent 399e35f8f5
commit 5cbae843d5
39 changed files with 378 additions and 380 deletions
+4 -4
View File
@@ -715,7 +715,7 @@ void Pet::GivePetXP(uint32 xp)
// Subtract newXP from amount needed for nextlevel
newXP -= nextLvlXP;
GivePetLevel(level+1);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(level+1)*PET_XP_FACTOR);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr.GetXPForLevel(level+1)*PET_XP_FACTOR));
// Make sure we're working with the upgraded levels for the pet XP-levels
level = getLevel();
@@ -801,7 +801,7 @@ bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseM
setPowerType(POWER_FOCUS);
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(getLevel()+1)*PET_XP_FACTOR);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr.GetXPForLevel(getLevel()+1)*PET_XP_FACTOR));
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
if (cinfo->type == CREATURE_TYPE_BEAST)
@@ -927,7 +927,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
}
case HUNTER_PET:
{
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForLevel(petlevel)*PET_XP_FACTOR);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr.GetXPForLevel(petlevel)*PET_XP_FACTOR));
//these formula may not be correct; however, it is designed to be close to what it should be
//this makes dps 0.5 of pets level
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
@@ -943,7 +943,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
case 510: // mage Water Elemental
{
//40% damage bonus of mage's frost damage
float val = m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST) * 0.4;
float val = m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST) * 0.4f;
if (val < 0)
val = 0;
SetBonusDamage(int32(val));