Fix code style for commit 9af47a5582b46b1678387c2e58f3b8e4de5ac2fa

This commit is contained in:
H0zen 2016-12-12 08:20:37 +02:00
parent 0b718b6543
commit 96026b6d42
5 changed files with 45 additions and 51 deletions

View File

@ -589,18 +589,17 @@ 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()) &&
(charmer->GetCharmGuid() == GetObjectGuid()))))
{
if (charmer)
charmer->Uncharm();
ForcedDespawn();
return;
}
if (m_aggroDelay <= update_diff)
Unit* charmer = GetCharmer();
if (GetCharmerGuid() && (!charmer || (!IsWithinDistInMap(charmer, GetMap()->GetVisibilityDistance()) &&
(charmer->GetCharmGuid() == GetObjectGuid()))))
{
if (charmer)
{ charmer->Uncharm(); }
ForcedDespawn();
return;
}
if (m_aggroDelay <= update_diff)
m_aggroDelay = 0;
else
m_aggroDelay -= update_diff;
@ -674,11 +673,9 @@ void Creature::RegenerateAll(uint32 update_diff)
if (m_regenTimer != 0)
{ return; }
if (!IsInCombat() || IsPolymorphed())
{
RegenerateHealth();
}
if (!IsInCombat() || IsPolymorphed())
{ RegenerateHealth(); }
RegeneratePower();
m_regenTimer = REGEN_TIME_FULL;
@ -763,15 +760,15 @@ 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
{ addvalue = uint32(Spirit * 0.80 * HealthIncreaseRate); }
}
if (addvalue == 0)
{ addvalue = maxValue / 3; }
if (addvalue == 0)
{ addvalue = maxValue / 3; }
ModifyHealth(addvalue);
}

View File

@ -1326,25 +1326,22 @@ void Player::Update(uint32 update_diff, uint32 p_time)
UpdateEnchantTime(update_diff);
UpdateHomebindTime(update_diff);
// 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);
}
// 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); }
Unit* charmed = GetCharm();
if (charmed && (GetCharmGuid() == charmed->GetObjectGuid()) &&
!IsWithinDistInMap(charmed, GetMap()->GetVisibilityDistance()))
{
Uncharm();
if(charmed->GetTypeId()==TYPEID_UNIT)
((Creature*)charmed)->ForcedDespawn();
}
Unit* charmed = GetCharm();
if (charmed && (GetCharmGuid() == charmed->GetObjectGuid()) && !IsWithinDistInMap(charmed, GetMap()->GetVisibilityDistance()))
{
Uncharm();
if(charmed->GetTypeId() == TYPEID_UNIT)
{ ((Creature*)charmed)->ForcedDespawn(); }
}
// Group update
SendUpdateToOutOfRangeGroupMembers();
if (IsHasDelayedTeleport())
// Group update
SendUpdateToOutOfRangeGroupMembers();
if (IsHasDelayedTeleport())
{ TeleportTo(m_teleport_dest, m_teleport_options); }
#ifdef ENABLE_PLAYERBOTS

View File

@ -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);

View File

@ -1123,12 +1123,12 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
{
// spells required only Real aura add/remove
if (!Real)
{ return; }
{ return; }
Unit* target = GetTarget();
if (!target || !target->IsAlive())
{ return; }
if (!target || !target->IsAlive())
{ return; }
// AT APPLY
if (apply)
@ -2219,11 +2219,11 @@ void Aura::HandleModPossessPet(bool apply, bool Real)
void Aura::HandleModCharm(bool apply, bool Real)
{
if (!Real)
{ return; }
{ return; }
Unit* target = GetTarget();
if (!target || !target->IsAlive())
{ return; }
if (!target || !target->IsAlive())
{ return; }
// not charm yourself
if (GetCasterGuid() == target->GetObjectGuid())
@ -2280,10 +2280,10 @@ 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(); }
if (caster->GetTypeId() == TYPEID_PLAYER)
{ ((Player*)caster)->CharmSpellInitialize(); }
}
else
{
@ -5676,13 +5676,13 @@ void SpellAuraHolder::UpdateAuraDuration()
if (GetAuraSlot() >= MAX_AURAS || m_isPassive)
{ return; }
if (m_target->GetTypeId() == TYPEID_PLAYER)
if (m_target->GetTypeId() == TYPEID_PLAYER)
{
WorldPacket data(SMSG_UPDATE_AURA_DURATION, 5);
data << uint8(GetAuraSlot());
data << uint32(GetAuraDuration());
((Player*)m_target)->SendDirectMessage(&data);
}
}
// not send in case player loading (will not work anyway until player not added to map), sent in visibility change code
if (m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading())

View File

@ -662,8 +662,8 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
return;
}
case 15998: // Capture Worg Pup
case 19614: // Despawn Caster
{
case 19614: // Despawn Caster
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
{ return; }