[9330] Fixed msvc compile warnings.

This commit is contained in:
AlexDereka 2010-02-08 16:27:27 +03:00
parent a167fd98d2
commit 696cba9c37
20 changed files with 142 additions and 144 deletions

View file

@ -1640,7 +1640,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
// If this is a creature and it attacks from behind it has a probability to daze it's victim
if( (damageInfo->hitOutCome==MELEE_HIT_CRIT || damageInfo->hitOutCome==MELEE_HIT_CRUSHING || damageInfo->hitOutCome==MELEE_HIT_NORMAL || damageInfo->hitOutCome==MELEE_HIT_GLANCING) &&
GetTypeId() != TYPEID_PLAYER && !((Creature*)this)->GetCharmerOrOwnerGUID() && !pVictim->HasInArc(M_PI, this) )
GetTypeId() != TYPEID_PLAYER && !((Creature*)this)->GetCharmerOrOwnerGUID() && !pVictim->HasInArc(M_PI_F, this) )
{
// -probability is between 0% and 40%
// 20% base chance
@ -2417,7 +2417,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
// Dodge chance
// only players can't dodge if attacker is behind
if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->HasInArc(M_PI,this))
if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->HasInArc(M_PI_F,this))
{
DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
}
@ -2445,7 +2445,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
// parry & block chances
// check if attack comes from behind, nobody can parry or block if attacker is behind
if (!pVictim->HasInArc(M_PI,this))
if (!pVictim->HasInArc(M_PI_F,this))
{
DEBUG_LOG ("RollMeleeOutcomeAgainst: attack came from behind.");
}
@ -2626,7 +2626,7 @@ void Unit::SendMeleeAttackStop(Unit* victim)
bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * /*spellProto*/, WeaponAttackType attackType)
{
if (pVictim->HasInArc(M_PI,this))
if (pVictim->HasInArc(M_PI_F,this))
{
/* Currently not exist spells with ignore block
// Ignore combat result aura (parry/dodge check on prepare)
@ -2748,7 +2748,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
if (attType == RANGED_ATTACK)
{
// only if in front
if (pVictim->HasInArc(M_PI,this))
if (pVictim->HasInArc(M_PI_F,this))
{
int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100;
tmp+=deflect_chance;
@ -2759,7 +2759,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell)
}
// Check for attack from behind
if (!pVictim->HasInArc(M_PI,this))
if (!pVictim->HasInArc(M_PI_F,this))
{
// Can`t dodge from behind in PvP (but its possible in PvE)
if (GetTypeId() == TYPEID_PLAYER && pVictim->GetTypeId() == TYPEID_PLAYER)
@ -2900,7 +2900,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell)
return SPELL_MISS_MISS;
// cast by caster in front of victim
if (pVictim->HasInArc(M_PI,this))
if (pVictim->HasInArc(M_PI_F,this))
{
int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100;
tmp+=deflect_chance;
@ -5403,7 +5403,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
return false;
Aura *aur = GetAura(71905, 0);
if (aur && aur->GetStackAmount() + 1 >= aur->GetSpellProto()->StackAmount)
if (aur && uint32(aur->GetStackAmount() + 1) >= aur->GetSpellProto()->StackAmount)
{
RemoveAurasDueToSpell(71905);
CastSpell(this, 71904, true); // Chaos Bane
@ -5576,7 +5576,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
if (dummySpell->SpellFamilyFlags == UI64LIT(0x0000000800000000))
{
// check attack comes not from behind
if (!HasInArc(M_PI, pVictim))
if (!HasInArc(M_PI_F, pVictim))
return false;
triggered_spell_id = 22858;
@ -5636,7 +5636,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{
Modifier* mod = triggeredByAura->GetModifier();
// if damage is more than need or target die from damage deal finish spell
if( mod->m_amount <= damage || (int32)GetHealth() <= damage )
if( mod->m_amount <= (int32)damage || GetHealth() <= damage )
{
// remember guid before aura delete
uint64 casterGuid = triggeredByAura->GetCasterGUID();
@ -5658,7 +5658,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
{
Modifier* mod = triggeredByAura->GetModifier();
// if damage is more than need deal finish spell
if( mod->m_amount <= damage )
if( mod->m_amount <= (int32)damage )
{
// remember guid before aura delete
uint64 casterGuid = triggeredByAura->GetCasterGUID();
@ -7298,7 +7298,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
return false;
// If target's health is not below equal certain value (35%) not proc
if ((pVictim->GetHealth() * 100 / pVictim->GetMaxHealth()) > aur->GetModifier()->m_amount)
if (int32(pVictim->GetHealth() * 100 / pVictim->GetMaxHealth()) > aur->GetModifier()->m_amount)
return false;
}
break;
@ -7546,7 +7546,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
else if (auraSpellInfo->SpellIconID == 2013)
{
// Check health condition - should drop to less 30% (damage deal after this!)
if (!(10*(int32(GetHealth() - damage)) < 3 * GetMaxHealth()))
if (!(10*(int32(GetHealth() - damage)) < int32(3 * GetMaxHealth())))
return false;
if(pVictim && pVictim->isAlive())
@ -10537,14 +10537,14 @@ bool Unit::canDetectInvisibilityOf(Unit const* u) const
continue;
// find invisibility level
uint32 invLevel = 0;
int32 invLevel = 0;
Unit::AuraList const& iAuras = u->GetAurasByType(SPELL_AURA_MOD_INVISIBILITY);
for(Unit::AuraList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
if(((*itr)->GetModifier()->m_miscvalue)==i && invLevel < (*itr)->GetModifier()->m_amount)
invLevel = (*itr)->GetModifier()->m_amount;
// find invisibility detect level
uint32 detectLevel = 0;
int32 detectLevel = 0;
Unit::AuraList const& dAuras = GetAurasByType(SPELL_AURA_MOD_INVISIBILITY_DETECTION);
for(Unit::AuraList::const_iterator itr = dAuras.begin(); itr != dAuras.end(); ++itr)
if(((*itr)->GetModifier()->m_miscvalue)==i && detectLevel < (*itr)->GetModifier()->m_amount)
@ -12909,21 +12909,21 @@ float Unit::GetAPMultiplier(WeaponAttackType attType, bool normalized)
Item *Weapon = ((Player*)this)->GetWeaponForAttack(attType, true, false);
if (!Weapon)
return 2.4; // fist attack
return 2.4f; // fist attack
switch (Weapon->GetProto()->InventoryType)
{
case INVTYPE_2HWEAPON:
return 3.3;
return 3.3f;
case INVTYPE_RANGED:
case INVTYPE_RANGEDRIGHT:
case INVTYPE_THROWN:
return 2.8;
return 2.8f;
case INVTYPE_WEAPON:
case INVTYPE_WEAPONMAINHAND:
case INVTYPE_WEAPONOFFHAND:
default:
return Weapon->GetProto()->SubClass==ITEM_SUBCLASS_WEAPON_DAGGER ? 1.7 : 2.4;
return Weapon->GetProto()->SubClass==ITEM_SUBCLASS_WEAPON_DAGGER ? 1.7f : 2.4f;
}
}