Merge pull request #181 from H0zen/cs
Fix code style for commit 9af47a5
This commit is contained in:
commit
5b183c8ebd
@ -589,17 +589,16 @@ void Creature::Update(uint32 update_diff, uint32 diff)
|
||||
}
|
||||
case ALIVE:
|
||||
{
|
||||
// unsummon pet that lost owner
|
||||
Unit* charmer = GetCharmer();
|
||||
if (GetCharmerGuid() && (!charmer ||
|
||||
(!IsWithinDistInMap(charmer, GetMap()->GetVisibilityDistance()) &&
|
||||
if (GetCharmerGuid() && (!charmer || (!IsWithinDistInMap(charmer, GetMap()->GetVisibilityDistance()) &&
|
||||
(charmer->GetCharmGuid() == GetObjectGuid()))))
|
||||
{
|
||||
if (charmer)
|
||||
charmer->Uncharm();
|
||||
{ charmer->Uncharm(); }
|
||||
ForcedDespawn();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_aggroDelay <= update_diff)
|
||||
m_aggroDelay = 0;
|
||||
else
|
||||
@ -675,9 +674,7 @@ void Creature::RegenerateAll(uint32 update_diff)
|
||||
{ return; }
|
||||
|
||||
if (!IsInCombat() || IsPolymorphed())
|
||||
{
|
||||
RegenerateHealth();
|
||||
}
|
||||
{ RegenerateHealth(); }
|
||||
|
||||
RegeneratePower();
|
||||
|
||||
@ -763,7 +760,7 @@ void Creature::RegenerateHealth()
|
||||
if (GetCharmerOrOwnerGuid())
|
||||
{
|
||||
float HealthIncreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_HEALTH);
|
||||
float Spirit = GetStat(STAT_SPIRIT);
|
||||
float Spirit = GetStat(STAT_SPIRIT); //for charmed creatures, spirit = 0!
|
||||
if (GetPower(POWER_MANA) > 0)
|
||||
{ addvalue = uint32(Spirit * 0.25 * HealthIncreaseRate); }
|
||||
else
|
||||
|
@ -1329,17 +1329,14 @@ void Player::Update(uint32 update_diff, uint32 p_time)
|
||||
// unsummon pet/charmed that lost owner
|
||||
Pet* pet = GetPet();
|
||||
if (pet && !pet->IsWithinDistInMap(this, GetMap()->GetVisibilityDistance()) && (GetCharmGuid() && (pet->GetObjectGuid() != GetCharmGuid())))
|
||||
{
|
||||
pet->Unsummon(PET_SAVE_REAGENTS, this);
|
||||
}
|
||||
{ pet->Unsummon(PET_SAVE_REAGENTS, this); }
|
||||
|
||||
Unit* charmed = GetCharm();
|
||||
if (charmed && (GetCharmGuid() == charmed->GetObjectGuid()) &&
|
||||
!IsWithinDistInMap(charmed, GetMap()->GetVisibilityDistance()))
|
||||
if (charmed && (GetCharmGuid() == charmed->GetObjectGuid()) && !IsWithinDistInMap(charmed, GetMap()->GetVisibilityDistance()))
|
||||
{
|
||||
Uncharm();
|
||||
if(charmed->GetTypeId()==TYPEID_UNIT)
|
||||
((Creature*)charmed)->ForcedDespawn();
|
||||
if(charmed->GetTypeId() == TYPEID_UNIT)
|
||||
{ ((Creature*)charmed)->ForcedDespawn(); }
|
||||
}
|
||||
|
||||
// Group update
|
||||
|
@ -2547,7 +2547,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
||||
m_caster->m_Events.AddEvent(Event, m_caster->m_Events.CalculateTime(1));
|
||||
|
||||
// Prevent casting at cast another spell (ServerSide check)
|
||||
if (!m_IsTriggeredSpell && m_caster->IsNonMeleeSpellCasted(false,true, true))
|
||||
if (!m_IsTriggeredSpell && m_caster->IsNonMeleeSpellCasted(false, true, true))
|
||||
{
|
||||
SendCastResult(SPELL_FAILED_SPELL_IN_PROGRESS);
|
||||
finish(false);
|
||||
|
@ -2280,7 +2280,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
|
||||
}
|
||||
}
|
||||
else if (Player *plTarget = target->ToPlayer())
|
||||
plTarget->SetClientControl(plTarget, 0);
|
||||
{ plTarget->SetClientControl(plTarget, 0); }
|
||||
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{ ((Player*)caster)->CharmSpellInitialize(); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user