Core: Random cleanup + compile fix

This commit is contained in:
Shauren committed 2012-02-23 13:01:16 +01:00
1 parent dbd8cbcfc4
commit dc28b92415
20 files changed
+114 -113

No files matched your search

+24 -6
View File
@@ -1469,8 +1469,8 @@ uint32 Unit::CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo
if (GetTypeId() == TYPEID_PLAYER)
{
float bonusPct = 0;
AuraEffectList const& ResIgnoreAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT);
for (AuraEffectList::const_iterator itr = ResIgnoreAuras.begin(); itr != ResIgnoreAuras.end(); ++itr)
AuraEffectList const& armorPenAuras = GetAuraEffectsByType(SPELL_AURA_MOD_ARMOR_PENETRATION_PCT);
for (AuraEffectList::const_iterator itr = armorPenAuras.begin(); itr != armorPenAuras.end(); ++itr)
{
if ((*itr)->GetSpellInfo()->EquippedItemClass == -1)
{
@@ -15459,7 +15459,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
// Inform pets (if any) when player kills target)
// MUST come after victim->setDeathState(JUST_DIED); or pet next target
// selection will get stuck on same target and break pet react state
if (Player* player = ToPlayer())
if (player)
{
Pet* pet = player->GetPet();
if (pet && pet->isAlive() && pet->isControlled())
@@ -17003,7 +17003,7 @@ void Unit::ExitVehicle(Position const* exitPosition)
return;
GetVehicleBase()->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, GetGUID());
//! The following call would not even be executed successfully as the
//! The following call would not even be executed successfully as the
//! SPELL_AURA_CONTROL_VEHICLE unapply handler already calls _ExitVehicle without
//! specifying an exitposition. The subsequent call below would return on if (!m_vehicle).
/*_ExitVehicle(exitPosition);*/
@@ -17456,10 +17456,28 @@ void Unit::SetFacingToObject(WorldObject* pObject)
SetFacingTo(GetAngle(pObject));
}
void Unit::SetWalk(bool enable)
bool Unit::SetWalk(bool enable)
{
if (enable == IsWalking())
return false;
if (enable)
AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
else
RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
}
return true;
}
bool Unit::SetLevitate(bool enable)
{
if (enable == IsLevitating())
return false;
if (enable)
AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
else
RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
return true;
}