Fix code style for commit 9af47a5582b46b1678387c2e58f3b8e4de5ac2fa
This commit is contained in:
parent
0b718b6543
commit
96026b6d42
@ -589,17 +589,16 @@ void Creature::Update(uint32 update_diff, uint32 diff)
|
|||||||
}
|
}
|
||||||
case ALIVE:
|
case ALIVE:
|
||||||
{
|
{
|
||||||
// unsummon pet that lost owner
|
|
||||||
Unit* charmer = GetCharmer();
|
Unit* charmer = GetCharmer();
|
||||||
if (GetCharmerGuid() && (!charmer ||
|
if (GetCharmerGuid() && (!charmer || (!IsWithinDistInMap(charmer, GetMap()->GetVisibilityDistance()) &&
|
||||||
(!IsWithinDistInMap(charmer, GetMap()->GetVisibilityDistance()) &&
|
|
||||||
(charmer->GetCharmGuid() == GetObjectGuid()))))
|
(charmer->GetCharmGuid() == GetObjectGuid()))))
|
||||||
{
|
{
|
||||||
if (charmer)
|
if (charmer)
|
||||||
charmer->Uncharm();
|
{ charmer->Uncharm(); }
|
||||||
ForcedDespawn();
|
ForcedDespawn();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_aggroDelay <= update_diff)
|
if (m_aggroDelay <= update_diff)
|
||||||
m_aggroDelay = 0;
|
m_aggroDelay = 0;
|
||||||
else
|
else
|
||||||
@ -675,9 +674,7 @@ void Creature::RegenerateAll(uint32 update_diff)
|
|||||||
{ return; }
|
{ return; }
|
||||||
|
|
||||||
if (!IsInCombat() || IsPolymorphed())
|
if (!IsInCombat() || IsPolymorphed())
|
||||||
{
|
{ RegenerateHealth(); }
|
||||||
RegenerateHealth();
|
|
||||||
}
|
|
||||||
|
|
||||||
RegeneratePower();
|
RegeneratePower();
|
||||||
|
|
||||||
@ -763,7 +760,7 @@ void Creature::RegenerateHealth()
|
|||||||
if (GetCharmerOrOwnerGuid())
|
if (GetCharmerOrOwnerGuid())
|
||||||
{
|
{
|
||||||
float HealthIncreaseRate = sWorld.getConfig(CONFIG_FLOAT_RATE_HEALTH);
|
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)
|
if (GetPower(POWER_MANA) > 0)
|
||||||
{ addvalue = uint32(Spirit * 0.25 * HealthIncreaseRate); }
|
{ addvalue = uint32(Spirit * 0.25 * HealthIncreaseRate); }
|
||||||
else
|
else
|
||||||
|
@ -1329,17 +1329,14 @@ void Player::Update(uint32 update_diff, uint32 p_time)
|
|||||||
// unsummon pet/charmed that lost owner
|
// unsummon pet/charmed that lost owner
|
||||||
Pet* pet = GetPet();
|
Pet* pet = GetPet();
|
||||||
if (pet && !pet->IsWithinDistInMap(this, GetMap()->GetVisibilityDistance()) && (GetCharmGuid() && (pet->GetObjectGuid() != GetCharmGuid())))
|
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();
|
Unit* charmed = GetCharm();
|
||||||
if (charmed && (GetCharmGuid() == charmed->GetObjectGuid()) &&
|
if (charmed && (GetCharmGuid() == charmed->GetObjectGuid()) && !IsWithinDistInMap(charmed, GetMap()->GetVisibilityDistance()))
|
||||||
!IsWithinDistInMap(charmed, GetMap()->GetVisibilityDistance()))
|
|
||||||
{
|
{
|
||||||
Uncharm();
|
Uncharm();
|
||||||
if(charmed->GetTypeId()==TYPEID_UNIT)
|
if(charmed->GetTypeId() == TYPEID_UNIT)
|
||||||
((Creature*)charmed)->ForcedDespawn();
|
{ ((Creature*)charmed)->ForcedDespawn(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Group update
|
// 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));
|
m_caster->m_Events.AddEvent(Event, m_caster->m_Events.CalculateTime(1));
|
||||||
|
|
||||||
// Prevent casting at cast another spell (ServerSide check)
|
// 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);
|
SendCastResult(SPELL_FAILED_SPELL_IN_PROGRESS);
|
||||||
finish(false);
|
finish(false);
|
||||||
|
@ -2280,7 +2280,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Player *plTarget = target->ToPlayer())
|
else if (Player *plTarget = target->ToPlayer())
|
||||||
plTarget->SetClientControl(plTarget, 0);
|
{ plTarget->SetClientControl(plTarget, 0); }
|
||||||
|
|
||||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
{ ((Player*)caster)->CharmSpellInitialize(); }
|
{ ((Player*)caster)->CharmSpellInitialize(); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user