Core: Codestyle clean-up

"plr"->player

Note: codestyle methods needs maintained, Player* player.
This commit is contained in:
Bootz
2011-11-07 11:06:39 -06:00
parent c51f6e7fa0
commit f75ec5ba2b
67 changed files with 852 additions and 852 deletions
@@ -2847,7 +2847,7 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode
if (target->GetTypeId() == TYPEID_UNIT)
target->SetFlying(apply);
if (Player* plr = target->m_movedPlayer)
if (Player* player = target->m_movedPlayer)
{
// allow flying
WorldPacket data;
@@ -2857,7 +2857,7 @@ void AuraEffect::HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode
data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);
data.append(target->GetPackGUID());
data << uint32(0); // unk
plr->SendDirectMessage(&data);
player->SendDirectMessage(&data);
}
}
@@ -3246,16 +3246,16 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp,
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
if (mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK && (apply || (!target->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED) && !target->HasAuraType(SPELL_AURA_FLY))))
{
if (Player* plr = target->m_movedPlayer)
if (Player* player = target->m_movedPlayer)
{
WorldPacket data;
if (apply)
data.Initialize(SMSG_MOVE_SET_CAN_FLY, 12);
else
data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12);
data.append(plr->GetPackGUID());
data.append(player->GetPackGUID());
data << uint32(0); // unknown
plr->SendDirectMessage(&data);
player->SendDirectMessage(&data);
}
}
@@ -5394,9 +5394,9 @@ void AuraEffect::HandleAuraConvertRune(AuraApplication const* aurApp, uint8 mode
if (target->GetTypeId() != TYPEID_PLAYER)
return;
Player* plr = (Player*)target;
Player* player = (Player*)target;
if (plr->getClass() != CLASS_DEATH_KNIGHT)
if (player->getClass() != CLASS_DEATH_KNIGHT)
return;
uint32 runes = m_amount;
@@ -5405,17 +5405,17 @@ void AuraEffect::HandleAuraConvertRune(AuraApplication const* aurApp, uint8 mode
{
for (uint32 i = 0; i < MAX_RUNES && runes; ++i)
{
if (GetMiscValue() != plr->GetCurrentRune(i))
if (GetMiscValue() != player->GetCurrentRune(i))
continue;
if (!plr->GetRuneCooldown(i))
if (!player->GetRuneCooldown(i))
{
plr->AddRuneByAuraEffect(i, RuneType(GetMiscValueB()), this);
player->AddRuneByAuraEffect(i, RuneType(GetMiscValueB()), this);
--runes;
}
}
}
else
plr->RemoveRunesByAuraEffect(this);
player->RemoveRunesByAuraEffect(this);
}
void AuraEffect::HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, bool apply) const
+4 -4
View File
@@ -4330,9 +4330,9 @@ SpellCastResult Spell::CheckRuneCost(uint32 runeCostID)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return SPELL_CAST_OK;
Player* plr = (Player*)m_caster;
Player* player = (Player*)m_caster;
if (plr->getClass() != CLASS_DEATH_KNIGHT)
if (player->getClass() != CLASS_DEATH_KNIGHT)
return SPELL_CAST_OK;
SpellRuneCostEntry const* src = sSpellRuneCostStore.LookupEntry(runeCostID);
@@ -4356,8 +4356,8 @@ SpellCastResult Spell::CheckRuneCost(uint32 runeCostID)
for (uint32 i = 0; i < MAX_RUNES; ++i)
{
RuneType rune = plr->GetCurrentRune(i);
if ((plr->GetRuneCooldown(i) == 0) && (runeCost[rune] > 0))
RuneType rune = player->GetCurrentRune(i);
if ((player->GetRuneCooldown(i) == 0) && (runeCost[rune] > 0))
runeCost[rune]--;
}
+15 -15
View File
@@ -5344,11 +5344,11 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
case 64142: // Upper Deck - Create Foam Sword
if (unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
Player* plr = unitTarget->ToPlayer();
Player* player = unitTarget->ToPlayer();
static uint32 const itemId[] = {45061, 45176, 45177, 45178, 45179, 0};
// player can only have one of these items
for (uint32 const* itr = &itemId[0]; *itr; ++itr)
if (plr->HasItemCount(*itr, 1, true))
if (player->HasItemCount(*itr, 1, true))
return;
DoCreateItem(effIndex, itemId[urand(0, 4)]);
return;
@@ -6155,15 +6155,15 @@ void Spell::EffectSelfResurrect(SpellEffIndex effIndex)
mana = CalculatePctN(m_caster->GetMaxPower(POWER_MANA), damage);
}
Player* plr = m_caster->ToPlayer();
plr->ResurrectPlayer(0.0f);
Player* player = m_caster->ToPlayer();
player->ResurrectPlayer(0.0f);
plr->SetHealth(health);
plr->SetPower(POWER_MANA, mana);
plr->SetPower(POWER_RAGE, 0);
plr->SetPower(POWER_ENERGY, plr->GetMaxPower(POWER_ENERGY));
player->SetHealth(health);
player->SetPower(POWER_MANA, mana);
player->SetPower(POWER_RAGE, 0);
player->SetPower(POWER_ENERGY, player->GetMaxPower(POWER_ENERGY));
plr->SpawnCorpseBones();
player->SpawnCorpseBones();
}
void Spell::EffectSkinning(SpellEffIndex /*effIndex*/)
@@ -6937,9 +6937,9 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
Player* plr = m_caster->ToPlayer();
Player* player = m_caster->ToPlayer();
if (plr->getClass() != CLASS_DEATH_KNIGHT)
if (player->getClass() != CLASS_DEATH_KNIGHT)
return;
// needed later
@@ -6949,9 +6949,9 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
if (count == 0) count = 1;
for (uint32 j = 0; j < MAX_RUNES && count > 0; ++j)
{
if (plr->GetRuneCooldown(j) && plr->GetCurrentRune(j) == RuneType(m_spellInfo->Effects[effIndex].MiscValue))
if (player->GetRuneCooldown(j) && player->GetCurrentRune(j) == RuneType(m_spellInfo->Effects[effIndex].MiscValue))
{
plr->SetRuneCooldown(j, 0);
player->SetRuneCooldown(j, 0);
--count;
}
}
@@ -6964,8 +6964,8 @@ void Spell::EffectActivateRune(SpellEffIndex effIndex)
for (uint32 i = 0; i < MAX_RUNES; ++i)
{
if (plr->GetRuneCooldown(i) && (plr->GetCurrentRune(i) == RUNE_FROST || plr->GetCurrentRune(i) == RUNE_DEATH))
plr->SetRuneCooldown(i, 0);
if (player->GetRuneCooldown(i) && (player->GetCurrentRune(i) == RUNE_FROST || player->GetCurrentRune(i) == RUNE_DEATH))
player->SetRuneCooldown(i, 0);
}
}
}