Core/Misc: Added 'f' after float values

This commit is contained in:
Fredi Machado
2011-10-17 07:38:27 -03:00
parent 04bb2f4a17
commit 97142102e0
17 changed files with 52 additions and 48 deletions
@@ -1286,7 +1286,7 @@ bool Creature::LoadFromDB(uint32 guid, Map* map)
if (canFly())
{
float tz = map->GetHeight(data->posX, data->posY, data->posZ, false);
if (data->posZ - tz > 0.1)
if (data->posZ - tz > 0.1f)
Relocate(data->posX, data->posY, tz);
}
}
@@ -371,7 +371,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID,
// rewarded honor points. Multiply with 10 to satisfy client
data << 10 * Trinity::Honor::hk_honor_at_level(_session->GetPlayer()->getLevel(), quest->GetRewHonorMultiplier());
data << float(0); // new 3.3.0, honor multiplier?
data << float(0.0f); // new 3.3.0, honor multiplier?
data << uint32(quest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast == 0)
data << int32(quest->GetRewSpellCast()); // casted spell
data << uint32(quest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles)
@@ -55,10 +55,10 @@ ObjectPosSelector::UsedPosList::value_type const* ObjectPosSelector::nextUsedPos
void ObjectPosSelector::AddUsedPos(float size, float angle, float dist)
{
if (angle>=0)
m_UsedPosLists[USED_POS_PLUS].insert(UsedPosList::value_type(angle, UsedPos(1.0, size, dist)));
if (angle >= 0)
m_UsedPosLists[USED_POS_PLUS].insert(UsedPosList::value_type(angle, UsedPos(1.0f, size, dist)));
else
m_UsedPosLists[USED_POS_MINUS].insert(UsedPosList::value_type(-angle, UsedPos(-1.0, size, dist)));
m_UsedPosLists[USED_POS_MINUS].insert(UsedPosList::value_type(-angle, UsedPos(-1.0f, size, dist)));
}
void ObjectPosSelector::InitializeAngle()
@@ -76,9 +76,9 @@ void ObjectPosSelector::InitializeAngle()
bool ObjectPosSelector::FirstAngle(float& angle)
{
if (m_UsedPosLists[USED_POS_PLUS].empty() && !m_UsedPosLists[USED_POS_MINUS].empty() )
return NextAngleFor(*m_UsedPosLists[USED_POS_MINUS].begin(), 1.0, USED_POS_PLUS, angle);
return NextAngleFor(*m_UsedPosLists[USED_POS_MINUS].begin(), 1.0f, USED_POS_PLUS, angle);
else if (m_UsedPosLists[USED_POS_MINUS].empty() && !m_UsedPosLists[USED_POS_PLUS].empty() )
return NextAngleFor(*m_UsedPosLists[USED_POS_PLUS].begin(), -1.0, USED_POS_MINUS, angle);
return NextAngleFor(*m_UsedPosLists[USED_POS_PLUS].begin(), -1.0f, USED_POS_MINUS, angle);
return false;
}
@@ -118,9 +118,9 @@ bool ObjectPosSelector::NextPosibleAngle(float& angle)
{
bool ok;
if (m_smallStepOk[USED_POS_PLUS])
ok = NextSmallStepAngle(1.0, USED_POS_PLUS, angle);
ok = NextSmallStepAngle(1.0f, USED_POS_PLUS, angle);
else
ok = NextAngleFor(*m_nextUsedPos[USED_POS_PLUS], 1.0, USED_POS_PLUS, angle);
ok = NextAngleFor(*m_nextUsedPos[USED_POS_PLUS], 1.0f, USED_POS_PLUS, angle);
if (!ok)
++m_nextUsedPos[USED_POS_PLUS]; // increase. only at fail (original or checked)
@@ -131,9 +131,9 @@ bool ObjectPosSelector::NextPosibleAngle(float& angle)
{
bool ok;
if (m_smallStepOk[USED_POS_MINUS])
ok = NextSmallStepAngle(-1.0, USED_POS_MINUS, angle);
ok = NextSmallStepAngle(-1.0f, USED_POS_MINUS, angle);
else
ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS], -1.0, USED_POS_MINUS, angle);
ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS], -1.0f, USED_POS_MINUS, angle);
if (!ok)
++m_nextUsedPos[USED_POS_MINUS];
@@ -142,10 +142,10 @@ bool ObjectPosSelector::NextPosibleAngle(float& angle)
else // both list empty
{
if (m_smallStepOk[USED_POS_PLUS] && (!m_smallStepOk[USED_POS_MINUS] || m_smallStepAngle[USED_POS_PLUS] <= m_smallStepAngle[USED_POS_MINUS]))
return NextSmallStepAngle(1.0, USED_POS_PLUS, angle);
return NextSmallStepAngle(1.0f, USED_POS_PLUS, angle);
// -- direction less updated
else if (m_smallStepOk[USED_POS_MINUS])
return NextSmallStepAngle(-1.0, USED_POS_MINUS, angle);
return NextSmallStepAngle(-1.0f, USED_POS_MINUS, angle);
}
// no angles
@@ -68,8 +68,8 @@ struct ObjectPosSelector
bool CheckOriginal() const
{
return (m_UsedPosLists[USED_POS_PLUS].empty() || CheckAngle(*m_UsedPosLists[USED_POS_PLUS].begin(), 1.0, 0)) &&
(m_UsedPosLists[USED_POS_MINUS].empty() || CheckAngle(*m_UsedPosLists[USED_POS_MINUS].begin(), -1.0, 0));
return (m_UsedPosLists[USED_POS_PLUS].empty() || CheckAngle(*m_UsedPosLists[USED_POS_PLUS].begin(), 1.0f, 0)) &&
(m_UsedPosLists[USED_POS_MINUS].empty() || CheckAngle(*m_UsedPosLists[USED_POS_MINUS].begin(), -1.0f, 0));
}
bool IsNonBalanced() const { return m_UsedPosLists[USED_POS_PLUS].empty() != m_UsedPosLists[USED_POS_MINUS].empty(); }
+1 -1
View File
@@ -618,7 +618,7 @@ void Pet::LoseHappiness()
return;
int32 addvalue = 670; //value is 70/35/17/8/4 (per min) * 1000 / 8 (timer 7.5 secs)
if (isInCombat()) //we know in combat happiness fades faster, multiplier guess
addvalue = int32(addvalue * 1.5);
addvalue = int32(addvalue * 1.5f);
ModifyPower(POWER_HAPPINESS, -addvalue);
}
+6 -6
View File
@@ -2631,7 +2631,7 @@ void Player::RegenerateHealth()
ApplyPctN(addvalue, GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT));
if (!IsStandState())
addvalue *= 1.5;
addvalue *= 1.5f;
}
// always regeneration bonus (including combat)
@@ -5063,7 +5063,7 @@ void Player::BuildPlayerRepop()
StopMirrorTimers(); //disable timers(bars)
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, (float)1.0); //see radius of death player?
SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, (float)1.0f); //see radius of death player?
// set and clear other
SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND);
@@ -6176,13 +6176,13 @@ static uint32 bonusSkillLevels[] = {75, 150, 225, 300, 375, 450};
bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
{
sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance/10.0);
sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance / 10.0f);
if (!SkillId)
return false;
if (Chance <= 0) // speedup in 0 chance case
{
sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance/10.0);
sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f);
return false;
}
@@ -6220,11 +6220,11 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step)
}
UpdateSkillEnchantments(SkillId, SkillValue, new_value);
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, SkillId);
sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance/10.0);
sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance / 10.0f);
return true;
}
sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance/10.0);
sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f);
return false;
}
+1 -1
View File
@@ -585,7 +585,7 @@ bool Unit::IsWithinMeleeRange(const Unit* obj, float dist) const
void Unit::GetRandomContactPoint(const Unit* obj, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const
{
float combat_reach = GetCombatReach();
if (combat_reach < 0.1) // sometimes bugged for players
if (combat_reach < 0.1f) // sometimes bugged for players
combat_reach = DEFAULT_COMBAT_REACH;
uint32 attacker_number = getAttackers().size();