diff options
| author | Bootz <Stage6Dev@EMPulseGaming.com> | 2011-11-07 11:06:39 -0600 |
|---|---|---|
| committer | Bootz <Stage6Dev@EMPulseGaming.com> | 2011-11-07 11:06:39 -0600 |
| commit | f75ec5ba2bcf4c44fd4e3b713f60178d26855e6d (patch) | |
| tree | 8c7ee70616e00c4bef794b16e740b05293eafcf3 /src/server/game/Entities/Unit | |
| parent | c51f6e7fa02710cacaa1ded36cbac757ec462400 (diff) | |
Core: Codestyle clean-up
"plr"->player
Note: codestyle methods needs maintained, Player* player.
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 110 | ||||
| -rwxr-xr-x | src/server/game/Entities/Unit/Unit.h | 4 |
2 files changed, 57 insertions, 57 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 3fd87cd272b..109479c3fe6 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5765,11 +5765,11 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Glyph of Ice Block case 56372: { - Player* plr = ToPlayer(); - if (!plr) + Player* player = ToPlayer(); + if (!player) return false; - SpellCooldowns const cooldowns = plr->GetSpellCooldowns(); + SpellCooldowns const cooldowns = player->GetSpellCooldowns(); // remove cooldowns on all ranks of Frost Nova for (SpellCooldowns::const_iterator itr = cooldowns.begin(); itr != cooldowns.end(); ++itr) { @@ -5777,7 +5777,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Frost Nova if (cdSpell && cdSpell->SpellFamilyName == SPELLFAMILY_MAGE && cdSpell->SpellFamilyFlags[0] & 0x00000040) - plr->RemoveSpellCooldown(cdSpell->Id, true); + player->RemoveSpellCooldown(cdSpell->Id, true); } break; } @@ -7059,26 +7059,26 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Windfury Weapon (Passive) 1-5 Ranks case 33757: { - Player* plr = ToPlayer(); - if (!plr || !castItem || !castItem->IsEquipped() || !victim || !victim->isAlive()) + Player* player = ToPlayer(); + if (!player || !castItem || !castItem->IsEquipped() || !victim || !victim->isAlive()) return false; // custom cooldown processing case - if (cooldown && plr->HasSpellCooldown(dummySpell->Id)) + if (cooldown && player->HasSpellCooldown(dummySpell->Id)) return false; if (triggeredByAura->GetBase() && castItem->GetGUID() != triggeredByAura->GetBase()->GetCastItemGUID()) return false; - WeaponAttackType attType = WeaponAttackType(plr->GetAttackBySlot(castItem->GetSlot())); + WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot())); if ((attType != BASE_ATTACK && attType != OFF_ATTACK) || !isAttackReady(attType)) return false; // Now compute real proc chance... uint32 chance = 20; - plr->ApplySpellMod(dummySpell->Id, SPELLMOD_CHANCE_OF_SUCCESS, chance); + player->ApplySpellMod(dummySpell->Id, SPELLMOD_CHANCE_OF_SUCCESS, chance); - Item* addWeapon = plr->GetWeaponForAttack(attType == BASE_ATTACK ? OFF_ATTACK : BASE_ATTACK, true); + Item* addWeapon = player->GetWeaponForAttack(attType == BASE_ATTACK ? OFF_ATTACK : BASE_ATTACK, true); uint32 enchant_id_add = addWeapon ? addWeapon->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)) : 0; SpellItemEnchantmentEntry const* pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id_add); if (pEnchant && pEnchant->spellid[0] == dummySpell->Id) @@ -7123,7 +7123,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // apply cooldown before cast to prevent processing itself if (cooldown) - plr->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown); + player->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown); // Attack Twice for (uint32 i = 0; i < 2; ++i) @@ -8074,9 +8074,9 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp { *handled = true; // Convert recently used Blood Rune to Death Rune - if (Player* plr = ToPlayer()) + if (Player* player = ToPlayer()) { - if (plr->getClass() != CLASS_DEATH_KNIGHT) + if (player->getClass() != CLASS_DEATH_KNIGHT) return false; RuneType rune = ToPlayer()->GetLastUsedRune(); @@ -8100,22 +8100,22 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp { if (dummySpell->SpellIconID == 2622) { - if (plr->GetCurrentRune(i) == RUNE_DEATH || - plr->GetBaseRune(i) == RUNE_BLOOD) + if (player->GetCurrentRune(i) == RUNE_DEATH || + player->GetBaseRune(i) == RUNE_BLOOD) continue; } else { - if (plr->GetCurrentRune(i) == RUNE_DEATH || - plr->GetBaseRune(i) != RUNE_BLOOD) + if (player->GetCurrentRune(i) == RUNE_DEATH || + player->GetBaseRune(i) != RUNE_BLOOD) continue; } - if (plr->GetRuneCooldown(i) != plr->GetRuneBaseCooldown(i)) + if (player->GetRuneCooldown(i) != player->GetRuneBaseCooldown(i)) continue; --runesLeft; // Mark aura as used - plr->AddRuneByAuraEffect(i, RUNE_DEATH, aurEff); + player->AddRuneByAuraEffect(i, RUNE_DEATH, aurEff); } return true; } @@ -8791,11 +8791,11 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg // Blade Barrier if (auraSpellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && auraSpellInfo->SpellIconID == 85) { - Player* plr = ToPlayer(); - if (!plr || plr->getClass() != CLASS_DEATH_KNIGHT) + Player* player = ToPlayer(); + if (!player || player->getClass() != CLASS_DEATH_KNIGHT) return false; - if (!plr->IsBaseRuneSlotsOnCooldown(RUNE_BLOOD)) + if (!player->IsBaseRuneSlotsOnCooldown(RUNE_BLOOD)) return false; } @@ -10144,20 +10144,20 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius) // only called in Player::SetSeer // so move it to Player? -void Unit::AddPlayerToVision(Player* plr) +void Unit::AddPlayerToVision(Player* player) { if (m_sharedVision.empty()) { setActive(true); SetWorldObject(true); } - m_sharedVision.push_back(plr); + m_sharedVision.push_back(player); } // only called in Player::SetSeer -void Unit::RemovePlayerFromVision(Player* plr) +void Unit::RemovePlayerFromVision(Player* player) { - m_sharedVision.remove(plr); + m_sharedVision.remove(player); if (m_sharedVision.empty()) { setActive(false); @@ -11894,7 +11894,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT); - if (Player* plr = ToPlayer()) + if (Player* player = ToPlayer()) { // mount as a vehicle if (VehicleId) @@ -11910,7 +11910,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) SendMessageToSet(&data, true); data.Initialize(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0); - plr->GetSession()->SendPacket(&data); + player->GetSession()->SendPacket(&data); // mounts can also have accessories GetVehicleKit()->InstallAllAccessories(false); @@ -11918,7 +11918,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) } // unsummon pet - Pet* pet = plr->GetPet(); + Pet* pet = player->GetPet(); if (pet) { Battleground* bg = ToPlayer()->GetBattleground(); @@ -11926,7 +11926,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) if (bg && bg->isArena()) pet->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); else - plr->UnsummonPetTemporaryIfAny(); + player->UnsummonPetTemporaryIfAny(); } } @@ -11962,15 +11962,15 @@ void Unit::Unmount() // only resummon old pet if the player is already added to a map // this prevents adding a pet to a not created map which would otherwise cause a crash // (it could probably happen when logging in after a previous crash) - if (Player* plr = ToPlayer()) + if (Player* player = ToPlayer()) { - if (Pet* pPet = plr->GetPet()) + if (Pet* pPet = player->GetPet()) { if (pPet->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && !pPet->HasUnitState(UNIT_STAT_STUNNED)) pPet->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); } else - plr->ResummonPetTemporaryUnSummonedIfAny(); + player->ResummonPetTemporaryUnSummonedIfAny(); } } @@ -13556,10 +13556,10 @@ void Unit::SetHealth(uint32 val) SetUInt32Value(UNIT_FIELD_HEALTH, val); // group update - if (Player* plr = ToPlayer()) + if (Player* player = ToPlayer()) { - if (plr->GetGroup()) - plr->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_CUR_HP); + if (player->GetGroup()) + player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_CUR_HP); } else if (Pet* pet = ToCreature()->ToPet()) { @@ -14772,9 +14772,9 @@ void Unit::ClearComboPointHolders() { uint32 lowguid = *m_ComboPointHolders.begin(); - Player* plr = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER)); - if (plr && plr->GetComboTarget() == GetGUID()) // recheck for safe - plr->ClearComboPoints(); // remove also guid from m_ComboPointHolders; + Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER)); + if (player && player->GetComboTarget() == GetGUID()) // recheck for safe + player->ClearComboPoints(); // remove also guid from m_ComboPointHolders; else m_ComboPointHolders.erase(lowguid); // or remove manually } @@ -15341,9 +15341,9 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) return; // Inform pets (if any) when player kills target) - if (Player* plr = ToPlayer()) + if (Player* player = ToPlayer()) { - Pet* pet = plr->GetPet(); + Pet* pet = player->GetPet(); if (pet && pet->isAlive() && pet->isControlled()) pet->AI()->KilledUnit(victim); } @@ -15915,10 +15915,10 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au } else { - Player* plr = ToPlayer(); - if (plr->isAFK()) - plr->ToggleAFK(); - plr->SetClientControl(this, 0); + Player* player = ToPlayer(); + if (player->isAFK()) + player->ToggleAFK(); + player->SetClientControl(this, 0); } // charm is set by aura, and aura effect remove handler was called during apply handler execution @@ -16981,25 +16981,25 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a if (aurApp && aurApp->GetRemoveMode()) return; - if (Player* plr = ToPlayer()) + if (Player* player = ToPlayer()) { - if (vehicle->GetBase()->GetTypeId() == TYPEID_PLAYER && plr->isInCombat()) + if (vehicle->GetBase()->GetTypeId() == TYPEID_PLAYER && player->isInCombat()) return; InterruptNonMeleeSpells(false); - plr->StopCastingCharm(); - plr->StopCastingBindSight(); + player->StopCastingCharm(); + player->StopCastingBindSight(); Unmount(); RemoveAurasByType(SPELL_AURA_MOUNTED); // drop flag at invisible in bg - if (Battleground* bg = plr->GetBattleground()) - bg->EventPlayerDroppedFlag(plr); + if (Battleground* bg = player->GetBattleground()) + bg->EventPlayerDroppedFlag(player); WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0); - plr->GetSession()->SendPacket(&data); + player->GetSession()->SendPacket(&data); - plr->UnsummonPetTemporaryIfAny(); + player->UnsummonPetTemporaryIfAny(); } ASSERT(!m_vehicle); @@ -17073,8 +17073,8 @@ void Unit::_ExitVehicle(Position const* exitPosition) SendMonsterMoveExitVehicle(&pos); Relocate(&pos); - if (Player* plr = ToPlayer()) - plr->ResummonPetTemporaryUnSummonedIfAny(); + if (Player* player = ToPlayer()) + player->ResummonPetTemporaryUnSummonedIfAny(); WorldPacket data2; BuildHeartBeatMsg(&data2); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 877bf115368..36844d97b67 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1730,8 +1730,8 @@ class Unit : public WorldObject //Player* GetMoverSource() const; Player* m_movedPlayer; SharedVisionList const& GetSharedVisionList() { return m_sharedVision; } - void AddPlayerToVision(Player* plr); - void RemovePlayerFromVision(Player* plr); + void AddPlayerToVision(Player* player); + void RemovePlayerFromVision(Player* player); bool HasSharedVision() const { return !m_sharedVision.empty(); } void RemoveBindSightAuras(); void RemoveCharmAuras(); |
