Core: More codestyle cleanups

This commit is contained in:
click
2011-06-12 01:47:45 +02:00
parent 158966dc79
commit f16df538ee
87 changed files with 309 additions and 309 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ void CombatAI::Reset()
events.Reset();
}
void CombatAI::JustDied(Unit *killer)
void CombatAI::JustDied(Unit* killer)
{
for (SpellVct::iterator i = spells.begin(); i != spells.end(); ++i)
if (AISpellInfo[*i].condition == AICOND_DIE)
+1 -1
View File
@@ -30,7 +30,7 @@ void PassiveAI::UpdateAI(const uint32)
EnterEvadeMode();
}
void PossessedAI::AttackStart(Unit *target)
void PossessedAI::AttackStart(Unit* target)
{
me->Attack(target, true);
}
+7 -7
View File
@@ -170,7 +170,7 @@ void PetAI::UpdateAI(const uint32 diff)
continue;
}
Spell *spell = new Spell(me, spellInfo, false, 0);
Spell* spell = new Spell(me, spellInfo, false, 0);
// Fix to allow pets on STAY to autocast
if (me->getVictim() && _CanAttack(me->getVictim()) && spell->CanAutoCast(me->getVictim()))
@@ -274,7 +274,7 @@ void PetAI::UpdateAllies()
m_AllySet.insert(owner->GetGUID());
}
void PetAI::KilledUnit(Unit *victim)
void PetAI::KilledUnit(Unit* victim)
{
// Called from Unit::Kill() in case where pet or owner kills something
// if owner killed this victim, pet may still be attacking something else
@@ -296,7 +296,7 @@ void PetAI::KilledUnit(Unit *victim)
HandleReturnMovement(); // Return
}
void PetAI::AttackStart(Unit *target)
void PetAI::AttackStart(Unit* target)
{
// Overrides Unit::AttackStart to correctly evaluate Pet states
@@ -317,7 +317,7 @@ Unit *PetAI::SelectNextTarget()
if (me->HasReactState(REACT_PASSIVE))
return NULL;
Unit *target = me->getAttackerForHelper();
Unit* target = me->getAttackerForHelper();
targetHasCC = false;
// Check pet's attackers first to prevent dragging mobs back to owner
@@ -376,7 +376,7 @@ void PetAI::HandleReturnMovement()
}
void PetAI::DoAttack(Unit *target, bool chase)
void PetAI::DoAttack(Unit* target, bool chase)
{
// Handles attack with or without chase and also resets all
// PetAI flags for next update / creature kill
@@ -448,7 +448,7 @@ void PetAI::MovementInform(uint32 moveType, uint32 data)
}
}
bool PetAI::_CanAttack(Unit *target)
bool PetAI::_CanAttack(Unit* target)
{
// Evaluates wether a pet can attack a specific
// target based on CommandState, ReactState and other flags
@@ -479,7 +479,7 @@ bool PetAI::_CanAttack(Unit *target)
return false;
}
bool PetAI::_CheckTargetCC(Unit *target)
bool PetAI::_CheckTargetCC(Unit* target)
{
if (me->GetCharmerOrOwnerGUID() && target->HasNegativeAuraWithAttribute(SPELL_ATTR0_BREAKABLE_BY_DAMAGE, me->GetCharmerOrOwnerGUID()))
return true;
+4 -4
View File
@@ -24,13 +24,13 @@
#include "SpellMgr.h"
#include "CreatureAIImpl.h"
void UnitAI::AttackStart(Unit *victim)
void UnitAI::AttackStart(Unit* victim)
{
if (victim && me->Attack(victim, true))
me->GetMotionMaster()->MoveChase(victim);
}
void UnitAI::AttackStartCaster(Unit *victim, float dist)
void UnitAI::AttackStartCaster(Unit* victim, float dist)
{
if (victim && me->Attack(victim, false))
me->GetMotionMaster()->MoveChase(victim, dist);
@@ -127,7 +127,7 @@ void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered)
void UnitAI::DoCast(uint32 spellId)
{
Unit *target = NULL;
Unit* target = NULL;
//sLog->outError("aggre %u %u", spellId, (uint32)AISpellInfo[spellId].target);
switch(AISpellInfo[spellId].target)
{
@@ -242,7 +242,7 @@ void SimpleCharmedAI::UpdateAI(const uint32 /*diff*/)
if (!charmer->isInCombat())
me->GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, me->GetFollowAngle());
Unit *target = me->getVictim();
Unit* target = me->getVictim();
if (!target || !charmer->canAttack(target))
AttackStart(charmer->SelectNearestTargetInAttackDistance());
}
+2 -2
View File
@@ -56,13 +56,13 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/)
if (!creature->HasReactState(REACT_PASSIVE) && !creature->getVictim())
{
if (Unit *target = creature->SelectNearestTarget(50))
if (Unit* target = creature->SelectNearestTarget(50))
creature->AI()->AttackStart(target);
else if (creature->isSummon())
{
if (Unit *summoner = creature->ToTempSummon()->GetSummoner())
{
Unit *target = summoner->getAttackerForHelper();
Unit* target = summoner->getAttackerForHelper();
if (!target && summoner->CanHaveThreatList() && !summoner->getThreatManager().isThreatListEmpty())
target = summoner->getThreatManager().getHostilTarget();
if (target && (creature->IsFriendlyTo(summoner) || creature->IsHostileTo(target)))
@@ -108,7 +108,7 @@ void SimpleAI::EnterCombat(Unit *who)
DoPlaySoundToSet(me, Aggro_Sound[random_text]);
}
void SimpleAI::KilledUnit(Unit *victim)
void SimpleAI::KilledUnit(Unit* victim)
{
uint8 random_text = urand(0, 2);
@@ -152,7 +152,7 @@ void SimpleAI::KilledUnit(Unit *victim)
DoCast(pTarget, Kill_Spell);
}
void SimpleAI::DamageTaken(Unit *killer, uint32 &damage)
void SimpleAI::DamageTaken(Unit* killer, uint32 &damage)
{
//Return if damage taken won't kill us
if (me->GetHealth() > damage)
@@ -392,7 +392,7 @@ bool AchievementCriteriaDataSet::Meets(Player const* source, Unit const* target,
return true;
}
AchievementMgr::AchievementMgr(Player *player)
AchievementMgr::AchievementMgr(Player* player)
{
m_player = player;
}
+3 -3
View File
@@ -103,7 +103,7 @@ bool ArenaTeam::AddMember(const uint64& playerGuid)
return false;
// Get player name and class either from db or ObjectMgr
Player *player = sObjectMgr->GetPlayer(playerGuid);
Player* player = sObjectMgr->GetPlayer(playerGuid);
if (player)
{
playerClass = player->getClass();
@@ -313,7 +313,7 @@ void ArenaTeam::DelMember(uint64 guid, bool cleanDb)
}
// Inform player and remove arena team info from player data
if (Player *player = sObjectMgr->GetPlayer(guid))
if (Player* player = sObjectMgr->GetPlayer(guid))
{
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
@@ -343,7 +343,7 @@ void ArenaTeam::Disband(WorldSession* session)
{
BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), "");
if (Player *player = session->GetPlayer())
if (Player* player = session->GetPlayer())
sLog->outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
}
@@ -960,7 +960,7 @@ void Battleground::RemovePlayerAtLeave(const uint64& guid, bool Transport, bool
}
// remove from raid group if player is member
if (Group *group = GetBgRaid(team))
if (Group* group = GetBgRaid(team))
{
if (!group->RemoveMember(guid)) // group was disbanded
{
@@ -47,7 +47,7 @@ uint16 BattlegroundAV::GetBonusHonor(uint8 kills) //TODO: move this function to
return Trinity::Honor::hk_honor_at_level(m_MaxLevel, kills);
}
void BattlegroundAV::HandleKillPlayer(Player *player, Player *killer)
void BattlegroundAV::HandleKillPlayer(Player* player, Player* killer)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -56,7 +56,7 @@ void BattlegroundAV::HandleKillPlayer(Player *player, Player *killer)
UpdateScore(player->GetTeam(), -1);
}
void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer)
void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer)
{
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av HandleKillUnit %i", unit->GetEntry());
if (GetStatus() != STATUS_IN_PROGRESS)
@@ -133,7 +133,7 @@ void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer)
ChangeMineOwner(AV_SOUTH_MINE, killer->GetTeam());
}
void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player)
void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;//maybe we should log this, cause this must be a cheater or a big bug
@@ -96,7 +96,7 @@ void BattlegroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
CheckArenaWinConditions();
}
void BattlegroundBE::HandleKillPlayer(Player *player, Player *killer)
void BattlegroundBE::HandleKillPlayer(Player* player, Player* killer)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -113,7 +113,7 @@ void BattlegroundBE::HandleKillPlayer(Player *player, Player *killer)
CheckArenaWinConditions();
}
bool BattlegroundBE::HandlePlayerUnderMap(Player *player)
bool BattlegroundBE::HandlePlayerUnderMap(Player* player)
{
player->TeleportTo(GetMapId(), 6238.930176f, 262.963470f, 0.889519f, player->GetOrientation(), false);
return true;
@@ -153,7 +153,7 @@ void BattlegroundDS::HandleAreaTrigger(Player *Source, uint32 Trigger)
}
}
bool BattlegroundDS::HandlePlayerUnderMap(Player *player)
bool BattlegroundDS::HandlePlayerUnderMap(Player* player)
{
player->TeleportTo(GetMapId(), 1299.046f, 784.825f, 9.338f, 2.422f, false);
return true;
@@ -574,7 +574,7 @@ void BattlegroundEY::RespawnFlagAfterDrop()
SetDroppedFlagGUID(0);
}
void BattlegroundEY::HandleKillPlayer(Player *player, Player *killer)
void BattlegroundEY::HandleKillPlayer(Player* player, Player* killer)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -425,7 +425,7 @@ bool BattlegroundIC::SetupBattleground()
return true;
}
void BattlegroundIC::HandleKillUnit(Creature *unit, Player* killer)
void BattlegroundIC::HandleKillUnit(Creature* unit, Player* killer)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -93,7 +93,7 @@ void BattlegroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
CheckArenaWinConditions();
}
void BattlegroundNA::HandleKillPlayer(Player *player, Player *killer)
void BattlegroundNA::HandleKillPlayer(Player* player, Player* killer)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -110,7 +110,7 @@ void BattlegroundNA::HandleKillPlayer(Player *player, Player *killer)
CheckArenaWinConditions();
}
bool BattlegroundNA::HandlePlayerUnderMap(Player *player)
bool BattlegroundNA::HandlePlayerUnderMap(Player* player)
{
player->TeleportTo(GetMapId(), 4055.504395f, 2919.660645f, 13.611241f, player->GetOrientation(), false);
return true;
@@ -93,7 +93,7 @@ void BattlegroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
CheckArenaWinConditions();
}
void BattlegroundRL::HandleKillPlayer(Player *player, Player *killer)
void BattlegroundRL::HandleKillPlayer(Player* player, Player* killer)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -110,7 +110,7 @@ void BattlegroundRL::HandleKillPlayer(Player *player, Player *killer)
CheckArenaWinConditions();
}
bool BattlegroundRL::HandlePlayerUnderMap(Player *player)
bool BattlegroundRL::HandlePlayerUnderMap(Player* player)
{
player->TeleportTo(GetMapId(), 1285.810547f, 1667.896851f, 39.957642f, player->GetOrientation(), false);
return true;
@@ -142,7 +142,7 @@ void BattlegroundRV::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
CheckArenaWinConditions();
}
void BattlegroundRV::HandleKillPlayer(Player *player, Player *killer)
void BattlegroundRV::HandleKillPlayer(Player* player, Player* killer)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
@@ -161,7 +161,7 @@ void BattlegroundRV::HandleKillPlayer(Player *player, Player *killer)
CheckArenaWinConditions();
}
bool BattlegroundRV::HandlePlayerUnderMap(Player *player)
bool BattlegroundRV::HandlePlayerUnderMap(Player* player)
{
player->TeleportTo(GetMapId(), 763.5f, -284, 28.276f, 2.422f, false);
return true;
@@ -897,7 +897,7 @@ void BattlegroundSA::UpdateDemolisherSpawns()
}
}
void BattlegroundSA::SendTransportInit(Player *player)
void BattlegroundSA::SendTransportInit(Player* player)
{
if (m_BgObjects[BG_SA_BOAT_ONE] || m_BgObjects[BG_SA_BOAT_TWO])
{
@@ -747,7 +747,7 @@ void BattlegroundWS::EndBattleground(uint32 winner)
Battleground::EndBattleground(winner);
}
void BattlegroundWS::HandleKillPlayer(Player *player, Player *killer)
void BattlegroundWS::HandleKillPlayer(Player* player, Player* killer)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
+1 -1
View File
@@ -126,7 +126,7 @@ bool ChatHandler::HandleDismountCommand(const char* /*args*/)
bool ChatHandler::HandleSaveCommand(const char* /*args*/)
{
Player *player = m_session->GetPlayer();
Player* player = m_session->GetPlayer();
// save GM account without delay and output message
if (m_session->GetSecurity() > SEC_PLAYER)
+1 -1
View File
@@ -396,7 +396,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
InstancePlayerBind *pBind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty(cMap->IsRaid()));
if (!pBind)
{
Group *group = _player->GetGroup();
Group* group = _player->GetGroup();
// if no bind exists, create a solo bind
InstanceGroupBind *gBind = group ? group->GetBoundInstance(target) : NULL; // if no bind exists, create a solo bind
if (!gBind)
+3 -3
View File
@@ -189,7 +189,7 @@ bool ChatHandler::HandleItemMoveCommand(const char* args)
//demorph player or unit
bool ChatHandler::HandleDeMorphCommand(const char* /*args*/)
{
Unit *target = getSelectedUnit();
Unit* target = getSelectedUnit();
if (!target)
target = m_session->GetPlayer();
@@ -740,7 +740,7 @@ bool ChatHandler::HandleWaterwalkCommand(const char* args)
if (!*args)
return false;
Player *player = getSelectedPlayer();
Player* player = getSelectedPlayer();
if (!player)
{
@@ -771,7 +771,7 @@ bool ChatHandler::HandleWaterwalkCommand(const char* args)
bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
{
Player *player = m_session->GetPlayer();
Player* player = m_session->GetPlayer();
Creature *creatureTarget = getSelectedCreature();
if (!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)
+8 -8
View File
@@ -1676,7 +1676,7 @@ bool ChatHandler::HandleGuildCreateCommand(const char *args)
return true;
}
Guild *guild = new Guild;
Guild* guild = new Guild;
if (!guild->Create (target, guildname))
{
delete guild;
@@ -1944,7 +1944,7 @@ bool ChatHandler::HandleReviveCommand(const char *args)
bool ChatHandler::HandleAuraCommand(const char *args)
{
Unit *target = getSelectedUnit();
Unit* target = getSelectedUnit();
if (!target)
{
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
@@ -1963,7 +1963,7 @@ bool ChatHandler::HandleAuraCommand(const char *args)
bool ChatHandler::HandleUnAuraCommand(const char *args)
{
Unit *target = getSelectedUnit();
Unit* target = getSelectedUnit();
if (!target)
{
SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
@@ -2367,7 +2367,7 @@ bool ChatHandler::HandleChangeWeather(const char *args)
uint32 type = (uint32)atoi(px); //0 to 3, 0: fine, 1: rain, 2: snow, 3: sand
float grade = (float)atof(py); //0 to 1, sending -1 is instand good weather
Player *player = m_session->GetPlayer();
Player* player = m_session->GetPlayer();
uint32 zoneid = player->GetZoneId();
Weather* wth = sWeatherMgr->FindWeather(zoneid);
@@ -4069,7 +4069,7 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
}
PSendSysMessage("player binds: %d", counter);
counter = 0;
Group *group = player->GetGroup();
Group* group = player->GetGroup();
if (group)
{
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
@@ -4406,7 +4406,7 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args)
if (!channel || !argstr)
return false;
Player *player = m_session->GetPlayer();
Player* player = m_session->GetPlayer();
Channel *chn = NULL;
if (ChannelMgr* cMgr = channelMgr(player->GetTeam()))
@@ -4467,7 +4467,7 @@ bool ChatHandler::HandlePlayAllCommand(const char *args)
bool ChatHandler::HandleFreezeCommand(const char *args)
{
std::string name;
Player *player;
Player* player;
char *TargetName = strtok((char*)args, " "); //get entered name
if (!TargetName) //if no name entered use target
{
@@ -4534,7 +4534,7 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
bool ChatHandler::HandleUnFreezeCommand(const char *args)
{
std::string name;
Player *player;
Player* player;
char *TargetName = strtok((char*)args, " "); //get entered name
if (!TargetName) //if no name entered use target
{
@@ -81,7 +81,7 @@ bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args)
// Detect target's GUID
uint64 guid = 0;
if (Player *player = sObjectMgr->GetPlayer(name.c_str()))
if (Player* player = sObjectMgr->GetPlayer(name.c_str()))
guid = player->GetGUID();
else
guid = sObjectMgr->GetPlayerGUIDByName(name);
@@ -133,7 +133,7 @@ bool ChatHandler::HandleGMTicketCloseByIdCommand(const char* args)
SendGlobalGMSysMessage(msg.c_str());
// Inform player, who submitted this ticket, that it is closed
if (Player *player = ticket->GetPlayer())
if (Player* player = ticket->GetPlayer())
if (player->IsInWorld())
{
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
@@ -183,7 +183,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
return true;
}
// If assigned to different player other than current, leave
Player *player = m_session->GetPlayer();
Player* player = m_session->GetPlayer();
if (ticket->IsAssignedNotTo(player->GetGUID()))
{
PSendSysMessage(LANG_COMMAND_TICKETALREADYASSIGNED, ticket->GetId(), target.c_str());
@@ -230,7 +230,7 @@ bool ChatHandler::HandleGMTicketUnAssignCommand(const char* args)
security = sAccountMgr->GetSecurity(accountId, realmID);
}
// Check security
Player *player = m_session->GetPlayer();
Player* player = m_session->GetPlayer();
if (security > uint32(player->GetSession()->GetSecurity()))
{
SendSysMessage(LANG_COMMAND_TICKETUNASSIGNSECURITY);
@@ -364,7 +364,7 @@ bool ChatHandler::HandleGMTicketCompleteCommand(const char* args)
return true;
}
if (Player *player = ticket->GetPlayer())
if (Player* player = ticket->GetPlayer())
if (player->IsInWorld())
ticket->SendResponse(player->GetSession());
@@ -1003,14 +1003,14 @@ void Creature::SetLootRecipient(Unit *unit)
return;
m_lootRecipient = player->GetGUID();
if (Group *group = player->GetGroup())
if (Group* group = player->GetGroup())
m_lootRecipientGroup = group->GetLowGUID();
SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED);
}
// return true if this creature is tapped by the player or by a member of his group.
bool Creature::isTappedBy(Player *player) const
bool Creature::isTappedBy(Player* player) const
{
if (player->GetGUID() == m_lootRecipient)
return true;
@@ -1441,7 +1441,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
return false;
if (who->isInCombat())
if (Unit *victim = who->getAttackerForHelper())
if (Unit* victim = who->getAttackerForHelper())
if (IsWithinDistInMap(victim, sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)))
force = true;
@@ -1794,7 +1794,7 @@ Unit* Creature::SelectNearestTarget(float dist) const
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Unit *target = NULL;
Unit* target = NULL;
{
if (dist == 0.0f)
@@ -1821,7 +1821,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Unit *target = NULL;
Unit* target = NULL;
if (dist > ATTACK_DISTANCE)
sLog->outError("Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > ATTACK_DISTANCE. Extra distance ignored.", GetGUIDLow(), GetEntry());
@@ -1957,7 +1957,7 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /
// use this function to avoid having hostile creatures attack
// friendlies and other mobs they shouldn't attack
bool Creature::_IsTargetAcceptable(const Unit *target) const
bool Creature::_IsTargetAcceptable(const Unit* target) const
{
ASSERT(target);
@@ -1977,7 +1977,7 @@ bool Creature::_IsTargetAcceptable(const Unit *target) const
}
const Unit *myVictim = getAttackerForHelper();
const Unit *targetVictim = target->getAttackerForHelper();
const Unit* targetVictim = target->getAttackerForHelper();
// if I'm already fighting target, or I'm hostile towards the target, the target is acceptable
if (myVictim == target || targetVictim == this || IsHostileTo(target))
@@ -26,7 +26,7 @@
CreatureGroupInfoType CreatureGroupMap;
void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature *member)
void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature* member)
{
Map *map = member->FindMap();
if (!map)
@@ -50,7 +50,7 @@ void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature *member)
}
}
void CreatureGroupManager::RemoveCreatureFromGroup(CreatureGroup *group, Creature *member)
void CreatureGroupManager::RemoveCreatureFromGroup(CreatureGroup* group, Creature* member)
{
sLog->outDebug(LOG_FILTER_UNITS, "Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow());
group->RemoveMember(member);
@@ -151,7 +151,7 @@ void CreatureGroupManager::LoadCreatureFormations()
sLog->outString();
}
void CreatureGroup::AddMember(Creature *member)
void CreatureGroup::AddMember(Creature* member)
{
sLog->outDebug(LOG_FILTER_UNITS, "CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow());
@@ -166,7 +166,7 @@ void CreatureGroup::AddMember(Creature *member)
member->SetFormation(this);
}
void CreatureGroup::RemoveMember(Creature *member)
void CreatureGroup::RemoveMember(Creature* member)
{
if (m_leader == member)
m_leader = NULL;
@@ -175,7 +175,7 @@ void CreatureGroup::RemoveMember(Creature *member)
member->SetFormation(NULL);
}
void CreatureGroup::MemberAttackStart(Creature *member, Unit *target)
void CreatureGroup::MemberAttackStart(Creature* member, Unit* target)
{
uint8 groupAI = CreatureGroupMap[member->GetDBTableGUIDLow()]->groupAI;
if (!groupAI)
@@ -229,7 +229,7 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z)
for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
{
Creature *member = itr->first;
Creature* member = itr->first;
if (member == m_leader || !member->isAlive() || member->getVictim())
continue;
+2 -2
View File
@@ -702,7 +702,7 @@ void Item::SetState(ItemUpdateState state, Player *forplayer)
}
}
void Item::AddToUpdateQueueOf(Player *player)
void Item::AddToUpdateQueueOf(Player* player)
{
if (IsInUpdateQueue())
return;
@@ -722,7 +722,7 @@ void Item::AddToUpdateQueueOf(Player *player)
uQueuePos = player->m_itemUpdateQueue.size()-1;
}
void Item::RemoveFromUpdateQueueOf(Player *player)
void Item::RemoveFromUpdateQueueOf(Player* player)
{
if (!IsInUpdateQueue())
return;
+4 -4
View File
@@ -301,7 +301,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
{
//WPAssert(this->ToPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
Player *player = const_cast<Object*>(this)->ToPlayer();
Player* player = const_cast<Object*>(this)->ToPlayer();
if (!player)
return;
@@ -450,7 +450,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
// 0x4
if (flags & UPDATEFLAG_HAS_TARGET) // packed guid (current target guid)
{
if (Unit *victim = ((Unit*)this)->getVictim())
if (Unit* victim = ((Unit*)this)->getVictim())
data->append(victim->GetPackGUID());
else
*data << uint8(0);
@@ -1982,7 +1982,7 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE
void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper)
{
Player *player = sObjectMgr->GetPlayer(receiver);
Player* player = sObjectMgr->GetPlayer(receiver);
if (!player || !player->GetSession())
return;
@@ -1996,7 +1996,7 @@ void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossW
void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper)
{
Player *player = sObjectMgr->GetPlayer(receiver);
Player* player = sObjectMgr->GetPlayer(receiver);
if (!player || !player->GetSession())
return;
+1 -1
View File
@@ -1572,7 +1572,7 @@ bool Pet::resetTalents()
if (!pet_family || pet_family->petTalentType < 0)
return false;
Player *player = owner->ToPlayer();
Player* player = owner->ToPlayer();
uint8 level = getLevel();
uint32 talentPointsForLevel = GetMaxTalentPointsForLevel(level);
+18 -18
View File
@@ -2926,7 +2926,7 @@ void Player::SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool re
GetSession()->SendPacket(&data);
}
void Player::GiveXP(uint32 xp, Unit *victim, float group_rate)
void Player::GiveXP(uint32 xp, Unit* victim, float group_rate)
{
if (xp < 1)
return;
@@ -8175,7 +8175,7 @@ void Player::UpdateEquipSpellsAtFormChange()
}
}
}
void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 procVictim, uint32 procEx)
void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx)
{
if (!target || !target->isAlive() || target == this)
return;
@@ -8211,7 +8211,7 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32
}
}
void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item *item, ItemTemplate const* proto)
void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item *item, ItemTemplate const* proto)
{
// Can do effect if any damage done to target
if (procVictim & PROC_FLAG_TAKEN_DAMAGE)
@@ -8349,7 +8349,7 @@ void Player::CastItemUseSpell(Item *item, SpellCastTargets const& targets, uint8
return;
}
Spell *spell = new Spell(this, spellInfo, false);
Spell* spell = new Spell(this, spellInfo, false);
spell->m_CastItem = item;
spell->m_cast_count = cast_count; //set count of casts
spell->SetSpellValue(SPELLVALUE_BASE_POINT0, learning_spell_id);
@@ -8380,7 +8380,7 @@ void Player::CastItemUseSpell(Item *item, SpellCastTargets const& targets, uint8
continue;
}
Spell *spell = new Spell(this, spellInfo, (count > 0));
Spell* spell = new Spell(this, spellInfo, (count > 0));
spell->m_CastItem = item;
spell->m_cast_count = cast_count; // set count of casts
spell->m_glyphIndex = glyphIndex; // glyph index
@@ -8408,7 +8408,7 @@ void Player::CastItemUseSpell(Item *item, SpellCastTargets const& targets, uint8
continue;
}
Spell *spell = new Spell(this, spellInfo, (count > 0));
Spell* spell = new Spell(this, spellInfo, (count > 0));
spell->m_CastItem = item;
spell->m_cast_count = cast_count; // set count of casts
spell->m_glyphIndex = glyphIndex; // glyph index
@@ -15730,7 +15730,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid)
uint32 real_entry = entry;
if (guid)
{
Creature *killed = GetMap()->GetCreature(guid);
Creature* killed = GetMap()->GetCreature(guid);
if (killed && killed->GetEntry())
real_entry = killed->GetEntry();
}
@@ -17760,7 +17760,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result)
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
m_boundInstances[i].clear();
Group *group = GetGroup();
Group* group = GetGroup();
//QueryResult *result = CharacterDatabase.PQuery("SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid));
if (result)
@@ -17836,7 +17836,7 @@ InstanceSave * Player::GetInstanceSave(uint32 mapid, bool raid)
InstancePlayerBind *pBind = GetBoundInstance(mapid, GetDifficulty(raid));
InstanceSave *pSave = pBind ? pBind->save : NULL;
if (!pBind || !pBind->perm)
if (Group *group = GetGroup())
if (Group* group = GetGroup())
if (InstanceGroupBind *groupBind = group->GetBoundInstance(this))
pSave = groupBind->save;
@@ -17980,7 +17980,7 @@ void Player::SendSavedInstances()
}
/// convert the player's binds to the group
void Player::ConvertInstancesToGroup(Player *player, Group *group, bool switchLeader)
void Player::ConvertInstancesToGroup(Player* player, Group* group, bool switchLeader)
{
// copy all binds to the group, when changing leader it's assumed the character
// will not have any solo binds
@@ -18929,7 +18929,7 @@ void Player::SendAttackSwingBadFacingAttack()
GetSession()->SendPacket(&data);
}
void Player::SendAutoRepeatCancel(Unit *target)
void Player::SendAutoRepeatCancel(Unit* target)
{
WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, target->GetPackGUID().size());
data.append(target->GetPackGUID()); // may be it's target guid
@@ -19601,7 +19601,7 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply)
}
// Restore spellmods in case of failed cast
void Player::RestoreSpellMods(Spell *spell, uint32 ownerAuraId)
void Player::RestoreSpellMods(Spell* spell, uint32 ownerAuraId)
{
if (!spell || spell->m_appliedMods.empty())
return;
@@ -21295,7 +21295,7 @@ void Player::ClearComboPoints()
m_comboTarget = 0;
}
void Player::SetGroup(Group *group, int8 subgroup)
void Player::SetGroup(Group* group, int8 subgroup)
{
if (group == NULL)
m_group.unlink();
@@ -21701,7 +21701,7 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value)
}
}
void Player::SendAurasForTarget(Unit *target)
void Player::SendAurasForTarget(Unit* target)
{
if (!target || target->GetVisibleAuras()->empty()) // speedup things
return;
@@ -22173,7 +22173,7 @@ bool Player::GetsRecruitAFriendBonus(bool forXP)
bool recruitAFriend = false;
if (getLevel() <= sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL) || !forXP)
{
if (Group *group = this->GetGroup())
if (Group* group = this->GetGroup())
{
for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
{
@@ -22551,7 +22551,7 @@ void Player::RemoveFromBattlegroundRaid()
SetOriginalGroup(NULL);
}
void Player::SetOriginalGroup(Group *group, int8 subgroup)
void Player::SetOriginalGroup(Group* group, int8 subgroup)
{
if (group == NULL)
m_originalGroup.unlink();
@@ -22882,7 +22882,7 @@ void Player::UpdateCharmedAI()
if (!charmer->isInCombat())
GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
Unit *target = getVictim();
Unit* target = getVictim();
if (!target || !charmer->canAttack(target))
{
target = charmer->SelectNearestTarget();
@@ -22894,7 +22894,7 @@ void Player::UpdateCharmedAI()
}
}
void Player::AddGlobalCooldown(SpellEntry const *spellInfo, Spell *spell)
void Player::AddGlobalCooldown(SpellEntry const *spellInfo, Spell* spell)
{
if (!spellInfo || !spellInfo->StartRecoveryTime)
return;
@@ -171,7 +171,7 @@ SocialMgr::~SocialMgr()
{
}
void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &friendInfo)
void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &friendInfo)
{
if (!player)
return;
@@ -219,7 +219,7 @@ void SocialMgr::MakeFriendStatusPacket(FriendsResult result, uint32 guid, WorldP
*data << uint64(guid);
}
void SocialMgr::SendFriendStatus(Player *player, FriendsResult result, uint32 friend_guid, bool broadcast)
void SocialMgr::SendFriendStatus(Player* player, FriendsResult result, uint32 friend_guid, bool broadcast)
{
FriendInfo fi;
@@ -255,7 +255,7 @@ void SocialMgr::SendFriendStatus(Player *player, FriendsResult result, uint32 fr
player->GetSession()->SendPacket(&data);
}
void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket *packet)
{
if (!player)
return;
+28 -28
View File
@@ -403,7 +403,7 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 T
AddUnitState(UNIT_STAT_MOVE);
}
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player *player)
void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 MoveFlags, uint32 time, float speedZ, Player* player)
{
WorldPacket data(SMSG_MONSTER_MOVE, 12+4+1+4+4+4+12+GetPackGUID().size());
data.append(GetPackGUID());
@@ -675,7 +675,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
if (GetTypeId() == TYPEID_PLAYER && this != pVictim)
{
Player *killer = this->ToPlayer();
Player* killer = this->ToPlayer();
// in bg, count dmg if victim is also a player
if (pVictim->GetTypeId() == TYPEID_PLAYER)
@@ -853,7 +853,7 @@ void Unit::CastSpell(Unit* Victim, SpellEntry const *spellInfo, bool triggered,
if (!originalCaster && triggeredByAura)
originalCaster = triggeredByAura->GetCasterGUID();
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster);
Spell* spell = new Spell(this, spellInfo, triggered, originalCaster);
spell->m_CastItem = castItem;
spell->prepare(&targets, triggeredByAura);
@@ -893,7 +893,7 @@ void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit*
if (!originalCaster && triggeredByAura)
originalCaster = triggeredByAura->GetCasterGUID();
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster);
Spell* spell = new Spell(this, spellInfo, triggered, originalCaster);
if (castItem)
{
@@ -924,7 +924,7 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered,
if (!originalCaster && triggeredByAura)
originalCaster = triggeredByAura->GetCasterGUID();
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster);
Spell* spell = new Spell(this, spellInfo, triggered, originalCaster);
SpellCastTargets targets;
targets.setDst(x, y, z, GetOrientation());
@@ -960,7 +960,7 @@ void Unit::CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castI
if (!originalCaster && triggeredByAura)
originalCaster = triggeredByAura->GetCasterGUID();
Spell *spell = new Spell(this, spellInfo, triggered, originalCaster);
Spell* spell = new Spell(this, spellInfo, triggered, originalCaster);
SpellCastTargets targets;
targets.setGOTarget(go);
@@ -2973,7 +2973,7 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi
ASSERT(spellType < CURRENT_MAX_SPELL);
//sLog->outDebug(LOG_FILTER_UNITS, "Interrupt spell for unit %u.", GetEntry());
Spell *spell = m_currentSpells[spellType];
Spell* spell = m_currentSpells[spellType];
if (spell
&& (withDelayed || spell->getState() != SPELL_STATE_DELAYED)
&& (withInstant || spell->GetCastTime() > 0))
@@ -4789,7 +4789,7 @@ void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
SendMessageToSet(&data, true);
}
void Unit::SendSpellNonMeleeDamageLog(Unit *target, uint32 SpellID, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit)
void Unit::SendSpellNonMeleeDamageLog(Unit* target, uint32 SpellID, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit)
{
SpellNonMeleeDamage log(this, target, SpellID, damageSchoolMask);
log.damage = Damage - AbsorbedDamage - Resist - Blocked;
@@ -4860,7 +4860,7 @@ void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
SendMessageToSet(&data, true);
}
void Unit::SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
void Unit::SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo)
{
WorldPacket data(SMSG_SPELLLOGMISS, (4+8+1+4+8+1));
data << uint32(spellID);
@@ -4947,7 +4947,7 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo *damageInfo)
SendMessageToSet(&data, true);
}
void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit *target, uint8 /*SwingType*/, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount)
void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType*/, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount)
{
CalcDamageInfo dmgInfo;
dmgInfo.HitInfo = HitInfo;
@@ -9156,7 +9156,7 @@ FactionTemplateEntry const* Unit::getFactionTemplateEntry() const
if (GetGUID() != guid)
{
if (const Player *player = ToPlayer())
if (const Player* player = ToPlayer())
sLog->outError("Player %s has invalid faction (faction template id) #%u", player->GetName(), getFaction());
else if (const Creature *creature = ToCreature())
sLog->outError("Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureInfo()->Entry, getFaction());
@@ -9427,7 +9427,7 @@ bool Unit::IsNeutralToAll() const
return my_faction->IsNeutralToAll();
}
bool Unit::Attack(Unit *victim, bool meleeAttack)
bool Unit::Attack(Unit* victim, bool meleeAttack)
{
if (!victim || victim == this)
return false;
@@ -9999,7 +9999,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
charm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
charm->ToPlayer()->UpdatePvPState();
}
else if (Player *player = charm->GetCharmerOrOwnerPlayerOrPlayerItself())
else if (Player* player = charm->GetCharmerOrOwnerPlayerOrPlayerItself())
{
charm->m_ControlledByPlayer = true;
charm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
@@ -10058,7 +10058,7 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth)
return gain;
}
Unit* Unit::SelectMagnetTarget(Unit *victim, SpellEntry const *spellInfo)
Unit* Unit::SelectMagnetTarget(Unit* victim, SpellEntry const *spellInfo)
{
if (!victim)
return NULL;
@@ -10115,7 +10115,7 @@ void Unit::RemoveAllControlled()
while (!m_Controlled.empty())
{
Unit *target = *m_Controlled.begin();
Unit* target = *m_Controlled.begin();
m_Controlled.erase(m_Controlled.begin());
if (target->GetCharmerGUID() == GetGUID())
target->RemoveCharmAuras();
@@ -12744,7 +12744,7 @@ void Unit::TauntApply(Unit* taunter)
if (this->ToCreature()->HasReactState(REACT_PASSIVE))
return;
Unit *target = getVictim();
Unit* target = getVictim();
if (target && target == taunter)
return;
@@ -12770,7 +12770,7 @@ void Unit::TauntFadeOut(Unit *taunter)
if (this->ToCreature()->HasReactState(REACT_PASSIVE))
return;
Unit *target = getVictim();
Unit* target = getVictim();
if (!target || target != taunter)
return;
@@ -15134,7 +15134,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect *triggeredByAura)
if (Player* modOwner = caster->GetSpellModOwner())
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_RADIUS, radius, NULL);
if (Unit *target = GetNextRandomRaidMemberOrPet(radius))
if (Unit* target = GetNextRandomRaidMemberOrPet(radius))
{
CastCustomSpell(target, spellProto->Id, &heal, NULL, NULL, true, NULL, triggeredByAura, caster_guid);
if (Aura * aura = target->GetAura(spellProto->Id, caster->GetGUID()))
@@ -15247,7 +15247,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
Player* looter = player;
if (Group *group = player->GetGroup())
if (Group* group = player->GetGroup())
{
group->BroadcastPacket(&data, group->GetMemberGroup(player->GetGUID()));
@@ -15472,8 +15472,8 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
}
else if (victim->GetTypeId() == TYPEID_UNIT)
{
Player *killer = this->ToPlayer();
Creature *killed = victim->ToCreature();
Player* killer = this->ToPlayer();
Creature* killed = victim->ToCreature();
sScriptMgr->OnCreatureKill(killer, killed);
}
}
@@ -15481,8 +15481,8 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
{
if (victim->GetTypeId() == TYPEID_PLAYER)
{
Creature *killer = this->ToCreature();
Player *killed = victim->ToPlayer();
Creature* killer = this->ToCreature();
Player* killed = victim->ToPlayer();
sScriptMgr->OnPlayerKilledByCreature(killer, killed);
}
}
@@ -16165,7 +16165,7 @@ void Unit::GetPartyMembers(std::list<Unit*> &TagUnitMap)
}
}
Aura * Unit::AddAura(uint32 spellId, Unit *target)
Aura * Unit::AddAura(uint32 spellId, Unit* target)
{
if (!target)
return NULL;
@@ -16180,7 +16180,7 @@ Aura * Unit::AddAura(uint32 spellId, Unit *target)
return AddAura(spellInfo, MAX_EFFECT_MASK, target);
}
Aura * Unit::AddAura(SpellEntry const *spellInfo, uint8 effMask, Unit *target)
Aura * Unit::AddAura(SpellEntry const *spellInfo, uint8 effMask, Unit* target)
{
if (!spellInfo)
return NULL;
@@ -16204,7 +16204,7 @@ Aura * Unit::AddAura(SpellEntry const *spellInfo, uint8 effMask, Unit *target)
return NULL;
}
void Unit::SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
void Unit::SetAuraStack(uint32 spellId, Unit* target, uint32 stack)
{
Aura *aura = target->GetAura(spellId, GetGUID());
if (!aura)
@@ -16363,7 +16363,7 @@ void Unit::UpdateObjectVisibility(bool forced)
void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
{
Player *player = NULL;
Player* player = NULL;
if (GetTypeId() == TYPEID_PLAYER)
player = (Player*)this;
else if (GetCharmer())
@@ -16746,7 +16746,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
if (itr->second.IsFitToRequirements(clicker, this))
{
Unit *caster = (itr->second.castFlags & NPC_CLICK_CAST_CASTER_CLICKER) ? clicker : this;
Unit *target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_CLICKER) ? clicker : this;
Unit* target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_CLICKER) ? clicker : this;
uint64 origCasterGUID = (itr->second.castFlags & NPC_CLICK_CAST_ORIG_CASTER_OWNER) ? GetOwnerGUID() : clicker->GetGUID();
SpellEntry const* spellEntry = sSpellStore.LookupEntry(itr->second.spellId);
+16 -16
View File
@@ -221,7 +221,7 @@ void Group::ConvertToRaid()
player->UpdateForQuestWorldObjects();
}
bool Group::AddInvite(Player *player)
bool Group::AddInvite(Player* player)
{
if (!player || player->GetGroupInvite())
return false;
@@ -242,7 +242,7 @@ bool Group::AddInvite(Player *player)
return true;
}
bool Group::AddLeaderInvite(Player *player)
bool Group::AddLeaderInvite(Player* player)
{
if (!AddInvite(player))
return false;
@@ -252,7 +252,7 @@ bool Group::AddLeaderInvite(Player *player)
return true;
}
void Group::RemoveInvite(Player *player)
void Group::RemoveInvite(Player* player)
{
if (player)
{
@@ -290,7 +290,7 @@ Player* Group::GetInvited(const std::string& name) const
return NULL;
}
bool Group::AddMember(Player *player)
bool Group::AddMember(Player* player)
{
// Get first not-full group
uint8 subGroup = 0;
@@ -400,7 +400,7 @@ bool Group::RemoveMember(const uint64 &guid, const RemoveMethod &method /*= GROU
// remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG allow 1 member group)
if (GetMembersCount() > (isBGGroup() ? 1u : 2u))
{
Player *player = sObjectMgr->GetPlayer(guid);
Player* player = sObjectMgr->GetPlayer(guid);
if (player)
{
// Battleground group handling
@@ -505,7 +505,7 @@ void Group::ChangeLeader(const uint64 &guid)
if (slot == m_memberSlots.end())
return;
Player *player = sObjectMgr->GetPlayer(slot->guid);
Player* player = sObjectMgr->GetPlayer(slot->guid);
// Don't allow switching leader to offline players
if (!player)
@@ -554,7 +554,7 @@ void Group::Disband(bool hideDestroy /* = false */)
{
sScriptMgr->OnGroupDisband(this);
Player *player;
Player* player;
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
player = sObjectMgr->GetPlayer(citr->guid);
@@ -850,7 +850,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject)
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
{
Player *playerToRoll = itr->getSource();
Player* playerToRoll = itr->getSource();
if (!playerToRoll || !playerToRoll->GetSession())
continue;
@@ -1024,7 +1024,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
{
uint8 maxresul = 0;
uint64 maxguid = (*roll->playerVote.begin()).first;
Player *player;
Player* player;
for (Roll::PlayerVote::const_iterator itr=roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr)
{
@@ -1071,7 +1071,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
{
uint8 maxresul = 0;
uint64 maxguid = (*roll->playerVote.begin()).first;
Player *player;
Player* player;
RollVote rollvote = NOT_VALID;
Roll::PlayerVote::iterator itr;
@@ -1184,7 +1184,7 @@ void Group::SendTargetIconList(WorldSession *session)
void Group::SendUpdate()
{
Player *player;
Player* player;
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
player = sObjectMgr->GetPlayer(citr->guid);
@@ -1244,7 +1244,7 @@ void Group::UpdatePlayerOutOfRange(Player* pPlayer)
if (!pPlayer || !pPlayer->IsInWorld())
return;
Player *player;
Player* player;
WorldPacket data;
pPlayer->GetSession()->BuildPartyMemberStatsChangedPacket(pPlayer, &data);
@@ -1351,7 +1351,7 @@ void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group)
if (!isBGGroup())
CharacterDatabase.PExecute("UPDATE group_member SET subgroup='%u' WHERE memberGuid='%u'", group, GUID_LOPART(guid));
Player *player = sObjectMgr->GetPlayer(guid);
Player* player = sObjectMgr->GetPlayer(guid);
// In case the moved player is online, update the player object with the new sub group references
if (player)
@@ -1543,7 +1543,7 @@ void Group::SetDungeonDifficulty(Difficulty difficulty)
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
{
Player *player = itr->getSource();
Player* player = itr->getSource();
if (!player->GetSession() || player->getLevel() < LEVELREQUIREMENT_HEROIC)
continue;
@@ -1560,7 +1560,7 @@ void Group::SetRaidDifficulty(Difficulty difficulty)
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
{
Player *player = itr->getSource();
Player* player = itr->getSource();
if (!player->GetSession() || player->getLevel() < LEVELREQUIREMENT_HEROIC)
continue;
@@ -1727,7 +1727,7 @@ void Group::UnbindInstance(uint32 mapid, uint8 difficulty, bool unload)
}
}
void Group::_homebindIfInstance(Player *player)
void Group::_homebindIfInstance(Player* player)
{
if (player && !player->isGameMaster() && sMapStore.LookupEntry(player->GetMapId())->IsDungeon())
player->m_InstanceValid = false;
+6 -6
View File
@@ -551,7 +551,7 @@ void Guild::Member::ChangeRank(uint8 newRank)
m_rankId = newRank;
// Update rank information in player's field, if he is online.
if (Player *player = FindPlayer())
if (Player* player = FindPlayer())
player->SetRank(newRank);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_GUILD_MEMBER_RANK);
@@ -2039,7 +2039,7 @@ void Guild::BroadcastToGuild(WorldSession *session, bool officerOnly, const std:
WorldPacket data;
ChatHandler::FillMessageData(&data, session, officerOnly ? CHAT_MSG_OFFICER : CHAT_MSG_GUILD, language, NULL, 0, msg.c_str(), NULL);
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (Player *player = itr->second->FindPlayer())
if (Player* player = itr->second->FindPlayer())
if (player->GetSession() && _HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) &&
!player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUIDLow()))
player->GetSession()->SendPacket(&data);
@@ -2050,14 +2050,14 @@ void Guild::BroadcastPacketToRank(WorldPacket *packet, uint8 rankId) const
{
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (itr->second->IsRank(rankId))
if (Player *player = itr->second->FindPlayer())
if (Player* player = itr->second->FindPlayer())
player->GetSession()->SendPacket(packet);
}
void Guild::BroadcastPacket(WorldPacket *packet) const
{
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (Player *player = itr->second->FindPlayer())
if (Player* player = itr->second->FindPlayer())
player->GetSession()->SendPacket(packet);
}
@@ -2135,7 +2135,7 @@ bool Guild::AddMember(const uint64& guid, uint8 rankId)
void Guild::DeleteMember(const uint64& guid, bool isDisbanding, bool isKicked)
{
uint32 lowguid = GUID_LOPART(guid);
Player *player = sObjectMgr->GetPlayer(guid);
Player* player = sObjectMgr->GetPlayer(guid);
// Guild master can be deleted when loading guild and guid doesn't exist in characters table
// or when he is removed from guild by gm command
@@ -2716,7 +2716,7 @@ void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (_MemberHasTabRights(itr->second->GetGUID(), tabId, GUILD_BANK_RIGHT_VIEW_TAB))
if (Player *player = itr->second->FindPlayer())
if (Player* player = itr->second->FindPlayer())
{
data.put<uint32>(rempos, uint32(_GetMemberRemainingSlots(player->GetGUID(), tabId)));
player->GetSession()->SendPacket(&data);
@@ -491,14 +491,14 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr)
InstanceSave::PlayerListType &pList = itr->second->m_playerList;
while (!pList.empty())
{
Player *player = *(pList.begin());
Player* player = *(pList.begin());
player->UnbindInstance(itr->second->GetMapId(), itr->second->GetDifficulty(), true);
}
InstanceSave::GroupListType &gList = itr->second->m_groupList;
while (!gList.empty())
{
Group *group = *(gList.begin());
Group* group = *(gList.begin());
group->UnbindInstance(itr->second->GetMapId(), itr->second->GetDifficulty(), true);
}
+1 -1
View File
@@ -374,7 +374,7 @@ bool LootItem::AllowedForPlayer(Player const* player) const
return true;
}
void LootItem::AddAllowedLooter(const Player *player)
void LootItem::AddAllowedLooter(const Player* player)
{
allowedGUIDs.insert(player->GetGUIDLow());
}
+1 -1
View File
@@ -128,7 +128,7 @@ void MailDraft::deleteIncludedItems(SQLTransaction& trans, bool inDB /*= false*/
void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32 receiver_guid, SQLTransaction& trans)
{
Player *receiver = sObjectMgr->GetPlayer(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER));
Player* receiver = sObjectMgr->GetPlayer(MAKE_NEW_GUID(receiver_guid, 0, HIGHGUID_PLAYER));
uint32 rc_account = 0;
if (!receiver)
+12 -12
View File
@@ -338,7 +338,7 @@ Map::EnsureGridCreated(const GridPair &p)
}
void
Map::EnsureGridLoadedAtEnter(const Cell &cell, Player *player)
Map::EnsureGridLoadedAtEnter(const Cell &cell, Player* player)
{
EnsureGridLoaded(cell);
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
@@ -391,7 +391,7 @@ void Map::LoadGrid(float x, float y)
EnsureGridLoaded(cell);
}
bool Map::Add(Player *player)
bool Map::Add(Player* player)
{
// Check if we are adding to correct map
ASSERT (player->GetMap() == this);
@@ -657,7 +657,7 @@ void Map::ProcessRelocationNotifies(const uint32 & diff)
}
}
void Map::Remove(Player *player, bool remove)
void Map::Remove(Player* player, bool remove)
{
player->RemoveFromWorld();
SendRemoveTransports(player);
@@ -724,7 +724,7 @@ Map::Remove(T *obj, bool remove)
}
void
Map::PlayerRelocation(Player *player, float x, float y, float z, float orientation)
Map::PlayerRelocation(Player* player, float x, float y, float z, float orientation)
{
ASSERT(player);
@@ -2198,7 +2198,7 @@ void InstanceMap::InitVisibilityDistance()
/*
Do map specific checks to see if the player can enter
*/
bool InstanceMap::CanEnter(Player *player)
bool InstanceMap::CanEnter(Player* player)
{
if (player->GetMapRef().getTarget() == this)
{
@@ -2260,7 +2260,7 @@ bool InstanceMap::CanEnter(Player *player)
/*
Do map specific checks and add the player to the map if successful.
*/
bool InstanceMap::Add(Player *player)
bool InstanceMap::Add(Player* player)
{
// TODO: Not sure about checking player level: already done in HandleAreaTriggerOpcode
// GMs still can teleport player in instance.
@@ -2275,7 +2275,7 @@ bool InstanceMap::Add(Player *player)
// Dungeon only code
if (IsDungeon())
{
Group *group = player->GetGroup();
Group* group = player->GetGroup();
// increase current instances (hourly limit)
if (!group || !group->isLFGGroup())
@@ -2386,7 +2386,7 @@ void InstanceMap::Update(const uint32& t_diff)
i_data->Update(t_diff);
}
void InstanceMap::Remove(Player *player, bool remove)
void InstanceMap::Remove(Player* player, bool remove)
{
sLog->outDetail("MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName());
//if last player set unload timer
@@ -2471,7 +2471,7 @@ bool InstanceMap::Reset(uint8 method)
return m_mapRefManager.isEmpty();
}
void InstanceMap::PermBindAllPlayers(Player *player)
void InstanceMap::PermBindAllPlayers(Player* player)
{
if (!IsDungeon())
return;
@@ -2483,7 +2483,7 @@ void InstanceMap::PermBindAllPlayers(Player *player)
return;
}
Group *group = player->GetGroup();
Group* group = player->GetGroup();
// group members outside the instance group don't get bound
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
{
@@ -2613,7 +2613,7 @@ bool BattlegroundMap::Add(Player* player)
return Map::Add(player);
}
void BattlegroundMap::Remove(Player *player, bool remove)
void BattlegroundMap::Remove(Player* player, bool remove)
{
sLog->outDetail("MAP: Removing player '%s' from bg '%u' of map '%s' before relocating to another map", player->GetName(), GetInstanceId(), GetMapName());
Map::Remove(player, remove);
@@ -2652,7 +2652,7 @@ Map::GetDynamicObject(uint64 guid)
return ObjectAccessor::GetObjectInMap(guid, this, (DynamicObject*)NULL);
}
void Map::UpdateIteratorBack(Player *player)
void Map::UpdateIteratorBack(Player* player)
{
if (m_mapRefIter == player->GetMapRef())
m_mapRefIter = m_mapRefIter->nocheck_prev();
+1 -1
View File
@@ -135,7 +135,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player)
if (!pBind || !pBind->perm)
{
InstanceGroupBind *groupBind = NULL;
Group *group = player->GetGroup();
Group* group = player->GetGroup();
// use the player's difficulty setting (it may not be the same as the group's)
if (group)
{
+2 -2
View File
@@ -282,7 +282,7 @@ bool OPvPCapturePoint::Update(uint32 diff)
{
for (PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end();)
{
Player *player = *itr;
Player* player = *itr;
++itr;
if (!m_capturePoint->IsWithinDistInMap(player, radius) || !player->IsOutdoorPvPActive())
HandlePlayerLeave(player);
@@ -430,7 +430,7 @@ void OPvPCapturePoint::SendObjectiveComplete(uint32 id, uint64 guid)
(*itr)->KilledMonsterCredit(id, guid);
}
void OutdoorPvP::HandleKill(Player *killer, Unit* killed)
void OutdoorPvP::HandleKill(Player* killer, Unit* killed)
{
if (Group * pGroup = killer->GetGroup())
{
+20 -20
View File
@@ -1074,47 +1074,47 @@ bool ScriptMgr::OnCriteriaCheck(AchievementCriteriaData const* data, Player* sou
}
// Player
void ScriptMgr::OnPVPKill(Player *killer, Player *killed)
void ScriptMgr::OnPVPKill(Player* killer, Player* killed)
{
FOREACH_SCRIPT(PlayerScript)->OnPVPKill(killer, killed);
}
void ScriptMgr::OnCreatureKill(Player *killer, Creature *killed)
void ScriptMgr::OnCreatureKill(Player* killer, Creature* killed)
{
FOREACH_SCRIPT(PlayerScript)->OnCreatureKill(killer, killed);
}
void ScriptMgr::OnPlayerKilledByCreature(Creature *killer, Player *killed)
void ScriptMgr::OnPlayerKilledByCreature(Creature* killer, Player* killed)
{
FOREACH_SCRIPT(PlayerScript)->OnPlayerKilledByCreature(killer, killed);
}
void ScriptMgr::OnPlayerLevelChanged(Player *player, uint8 oldLevel)
void ScriptMgr::OnPlayerLevelChanged(Player* player, uint8 oldLevel)
{
FOREACH_SCRIPT(PlayerScript)->OnLevelChanged(player, oldLevel);
}
void ScriptMgr::OnPlayerFreeTalentPointsChanged(Player *player, uint32 points)
void ScriptMgr::OnPlayerFreeTalentPointsChanged(Player* player, uint32 points)
{
FOREACH_SCRIPT(PlayerScript)->OnFreeTalentPointsChanged(player, points);
}
void ScriptMgr::OnPlayerTalentsReset(Player *player, bool no_cost)
void ScriptMgr::OnPlayerTalentsReset(Player* player, bool no_cost)
{
FOREACH_SCRIPT(PlayerScript)->OnTalentsReset(player, no_cost);
}
void ScriptMgr::OnPlayerMoneyChanged(Player *player, int32& amount)
void ScriptMgr::OnPlayerMoneyChanged(Player* player, int32& amount)
{
FOREACH_SCRIPT(PlayerScript)->OnMoneyChanged(player, amount);
}
void ScriptMgr::OnGivePlayerXP(Player *player, uint32& amount, Unit *victim)
void ScriptMgr::OnGivePlayerXP(Player* player, uint32& amount, Unit* victim)
{
FOREACH_SCRIPT(PlayerScript)->OnGiveXP(player, amount, victim);
}
void ScriptMgr::OnPlayerReputationChange(Player *player, uint32 factionID, int32& standing, bool incremental)
void ScriptMgr::OnPlayerReputationChange(Player* player, uint32 factionID, int32& standing, bool incremental)
{
FOREACH_SCRIPT(PlayerScript)->OnReputationChange(player, factionID, standing, incremental);
}
@@ -1124,7 +1124,7 @@ void ScriptMgr::OnPlayerDuelRequest(Player *target, Player *challenger)
FOREACH_SCRIPT(PlayerScript)->OnDuelRequest(target, challenger);
}
void ScriptMgr::OnPlayerDuelStart(Player *player1, Player *player2)
void ScriptMgr::OnPlayerDuelStart(Player* player1, Player* player2)
{
FOREACH_SCRIPT(PlayerScript)->OnDuelStart(player1, player2);
}
@@ -1169,22 +1169,22 @@ void ScriptMgr::OnPlayerTextEmote(Player* player, uint32 text_emote, uint32 emot
FOREACH_SCRIPT(PlayerScript)->OnTextEmote(player, text_emote, emoteNum, guid);
}
void ScriptMgr::OnPlayerSpellCast(Player *player, Spell *spell, bool skipCheck)
void ScriptMgr::OnPlayerSpellCast(Player* player, Spell* spell, bool skipCheck)
{
FOREACH_SCRIPT(PlayerScript)->OnSpellCast(player, spell, skipCheck);
}
void ScriptMgr::OnPlayerLogin(Player *player)
void ScriptMgr::OnPlayerLogin(Player* player)
{
FOREACH_SCRIPT(PlayerScript)->OnLogin(player);
}
void ScriptMgr::OnPlayerLogout(Player *player)
void ScriptMgr::OnPlayerLogout(Player* player)
{
FOREACH_SCRIPT(PlayerScript)->OnLogout(player);
}
void ScriptMgr::OnPlayerCreate(Player *player)
void ScriptMgr::OnPlayerCreate(Player* player)
{
FOREACH_SCRIPT(PlayerScript)->OnCreate(player);
}
@@ -1200,32 +1200,32 @@ void ScriptMgr::OnPlayerBindToInstance(Player* player, Difficulty difficulty, ui
}
// Guild
void ScriptMgr::OnGuildAddMember(Guild *guild, Player *player, uint8& plRank)
void ScriptMgr::OnGuildAddMember(Guild* guild, Player* player, uint8& plRank)
{
FOREACH_SCRIPT(GuildScript)->OnAddMember(guild, player, plRank);
}
void ScriptMgr::OnGuildRemoveMember(Guild *guild, Player *player, bool isDisbanding, bool isKicked)
void ScriptMgr::OnGuildRemoveMember(Guild* guild, Player* player, bool isDisbanding, bool isKicked)
{
FOREACH_SCRIPT(GuildScript)->OnRemoveMember(guild, player, isDisbanding, isKicked);
}
void ScriptMgr::OnGuildMOTDChanged(Guild *guild, const std::string& newMotd)
void ScriptMgr::OnGuildMOTDChanged(Guild* guild, const std::string& newMotd)
{
FOREACH_SCRIPT(GuildScript)->OnMOTDChanged(guild, newMotd);
}
void ScriptMgr::OnGuildInfoChanged(Guild *guild, const std::string& newInfo)
void ScriptMgr::OnGuildInfoChanged(Guild* guild, const std::string& newInfo)
{
FOREACH_SCRIPT(GuildScript)->OnInfoChanged(guild, newInfo);
}
void ScriptMgr::OnGuildCreate(Guild *guild, Player* leader, const std::string& name)
void ScriptMgr::OnGuildCreate(Guild* guild, Player* leader, const std::string& name)
{
FOREACH_SCRIPT(GuildScript)->OnCreate(guild, leader, name);
}
void ScriptMgr::OnGuildDisband(Guild *guild)
void ScriptMgr::OnGuildDisband(Guild* guild)
{
FOREACH_SCRIPT(GuildScript)->OnDisband(guild);
}
@@ -37,7 +37,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data)
uint64 guid; //NPC guid
recv_data >> guid;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
@@ -42,7 +42,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data)
recv_data >> guid;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid)));
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
if (!unit)
return;
@@ -591,7 +591,7 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data)
uint64 guid;
recv_data >> guid;
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
if (!unit)
return;
@@ -611,7 +611,7 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data)
uint64 guid;
recv_data >> guid;
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
if (!unit)
return;
@@ -639,7 +639,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data)
if (_player->InBattleground())
return;
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
if (!unit)
return;
@@ -828,7 +828,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
pCurrChar->SetInGameTime(getMSTime());
// announce group about member online (must be after add to player list to receive announce to self)
if (Group *group = pCurrChar->GetGroup())
if (Group* group = pCurrChar->GetGroup())
{
//pCurrChar->groupInfo.group->SendInit(this); // useless
group->SendUpdate();
@@ -262,7 +262,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
break;
}
Player *player = sObjectMgr->GetPlayer(to.c_str());
Player* player = sObjectMgr->GetPlayer(to.c_str());
uint32 tSecurity = GetSecurity();
uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
@@ -294,7 +294,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
case CHAT_MSG_PARTY_LEADER:
{
// if player is in battleground, he cannot say to battleground members by /p
Group *group = GetPlayer()->GetOriginalGroup();
Group* group = GetPlayer()->GetOriginalGroup();
if (!group)
{
group = _player->GetGroup();
@@ -315,7 +315,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
{
if (GetPlayer()->GetGuildId())
{
if (Guild *guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
{
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild);
@@ -327,7 +327,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
{
if (GetPlayer()->GetGuildId())
{
if (Guild *guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
{
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild);
@@ -338,7 +338,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
case CHAT_MSG_RAID:
{
// if player is in battleground, he cannot say to battleground members by /ra
Group *group = GetPlayer()->GetOriginalGroup();
Group* group = GetPlayer()->GetOriginalGroup();
if (!group)
{
group = GetPlayer()->GetGroup();
@@ -355,7 +355,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
case CHAT_MSG_RAID_LEADER:
{
// if player is in battleground, he cannot say to battleground members by /ra
Group *group = GetPlayer()->GetOriginalGroup();
Group* group = GetPlayer()->GetOriginalGroup();
if (!group)
{
group = GetPlayer()->GetGroup();
@@ -371,7 +371,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
} break;
case CHAT_MSG_RAID_WARNING:
{
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (!group || !group->isRaidGroup() || !(group->IsLeader(GetPlayer()->GetGUID()) || group->IsAssistant(GetPlayer()->GetGUID())) || group->isBGGroup())
return;
@@ -385,7 +385,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
case CHAT_MSG_BATTLEGROUND:
{
//battleground raid is always in Player->GetGroup(), never in GetOriginalGroup()
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (!group || !group->isBGGroup())
return;
@@ -398,7 +398,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
case CHAT_MSG_BATTLEGROUND_LEADER:
{
// battleground raid is always in Player->GetGroup(), never in GetOriginalGroup()
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (!group || !group->isBGGroup() || !group->IsLeader(GetPlayer()->GetGUID()))
return;
@@ -584,7 +584,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data)
recv_data >> iguid;
recv_data >> unk; // probably related to spam reporting
Player *player = sObjectMgr->GetPlayer(iguid);
Player* player = sObjectMgr->GetPlayer(iguid);
if (!player || !player->GetSession())
return;
@@ -73,7 +73,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
return;
}
Player *player = sObjectMgr->GetPlayer(membername.c_str());
Player* player = sObjectMgr->GetPlayer(membername.c_str());
// no player
if (!player)
@@ -110,11 +110,11 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
return;
}
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (group && group->isBGGroup())
group = GetPlayer()->GetOriginalGroup();
Group *group2 = player->GetGroup();
Group* group2 = player->GetGroup();
if (group2 && group2->isBGGroup())
group2 = player->GetOriginalGroup();
// player already in another group or invited
@@ -197,7 +197,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ACCEPT");
recv_data.read_skip<uint32>();
Group *group = GetPlayer()->GetGroupInvite();
Group* group = GetPlayer()->GetGroupInvite();
if (!group)
return;
@@ -363,14 +363,14 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_LEADER");
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
uint64 guid;
recv_data >> guid;
Player *player = sObjectMgr->GetPlayer(guid);
Player* player = sObjectMgr->GetPlayer(guid);
/** error handling **/
if (!player || !group->IsLeader(GetPlayer()->GetGUID()) || player->GetGroup() != group)
@@ -410,7 +410,7 @@ void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LOOT_METHOD");
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
@@ -520,7 +520,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_TARGET_UPDATE");
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
@@ -550,7 +550,7 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recv_data*/)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_RAID_CONVERT");
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
@@ -572,7 +572,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP");
// we will get correct pointer for group here, so we don't have to check if group is BG raid
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
@@ -610,7 +610,7 @@ void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER");
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
@@ -631,7 +631,7 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_PARTY_ASSIGNMENT");
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
@@ -665,7 +665,7 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK");
Group *group = GetPlayer()->GetGroup();
Group* group = GetPlayer()->GetGroup();
if (!group)
return;
@@ -708,7 +708,7 @@ void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket & /*recv_data*
// Is any reaction need?
}
void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacket *data)
void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacket *data)
{
uint32 mask = player->GetGroupUpdateFlag();
@@ -884,7 +884,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data)
uint64 Guid;
recv_data >> Guid;
Player *player = HashMapHolder<Player>::Find(Guid);
Player* player = HashMapHolder<Player>::Find(Guid);
if (!player)
{
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3+4+2);
@@ -91,7 +91,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
if (_player->PlayerTalkClass->IsGossipOptionCoded(gossipListId))
recv_data >> code;
Creature *unit = NULL;
Creature* unit = NULL;
GameObject *go = NULL;
if (IS_CRE_OR_VEH_GUID(guid))
{
@@ -1250,7 +1250,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data)
uint64 guid;
recv_data >> guid;
Player *player = sObjectMgr->GetPlayer(guid);
Player* player = sObjectMgr->GetPlayer(guid);
if (!player)
{
@@ -1691,7 +1691,7 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data)
uint64 guid;
recv_data.readPackGUID(guid);
Player *player = sObjectMgr->GetPlayer(guid);
Player* player = sObjectMgr->GetPlayer(guid);
if (!player)
return;
@@ -51,7 +51,7 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data)
uint64 guid;
recv_data >> guid;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TABARDDESIGNER);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TABARDDESIGNER);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTabardVendorActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid)));
@@ -80,7 +80,7 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data)
recv_data >> guid;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBankerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid)));
@@ -119,7 +119,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList");
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid)));
@@ -243,7 +243,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data)
recv_data >> guid >> spellId;
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u", uint32(GUID_LOPART(guid)), spellId);
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTrainerBuySpellOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid)));
@@ -309,7 +309,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
uint64 guid;
recv_data >> guid;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipHelloOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid)));
@@ -365,7 +365,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data)
sLog->outDebug(LOG_FILTER_PACKETIO, "string read: %s", code.c_str());
}
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
if (!unit)
{
sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
@@ -396,7 +396,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data)
recv_data >> guid;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_SPIRITHEALER);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_SPIRITHEALER);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSpiritHealerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid)));
@@ -451,7 +451,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data)
if (!GetPlayer()->IsInWorld() || !GetPlayer()->isAlive())
return;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_INNKEEPER);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_INNKEEPER);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBinderActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
@@ -868,7 +868,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data)
recv_data >> npcGUID >> itemGUID >> guildBank;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_REPAIR);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_REPAIR);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleRepairItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID)));
@@ -319,7 +319,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid
pet->GetCharmInfo()->SetIsFollowing(false);
}
Spell *spell = new Spell(pet, spellInfo, false);
Spell* spell = new Spell(pet, spellInfo, false);
SpellCastResult result = spell->CheckPetCast(unit_target);
@@ -774,7 +774,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
caster->ClearUnitState(UNIT_STAT_FOLLOW);
Spell *spell = new Spell(caster, spellInfo, false);
Spell* spell = new Spell(caster, spellInfo, false);
spell->m_cast_count = castCount; // probably pending spell cast
spell->m_targets = targets;
@@ -602,7 +602,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data)
uint8 signs = 0;
uint64 petitionguid, plguid;
uint32 type, junk;
Player *player;
Player* player;
recv_data >> junk; // this is not petition type!
recv_data >> petitionguid; // petition guid
recv_data >> plguid; // player guid
@@ -60,7 +60,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data)
uint64 guid;
recv_data >> guid;
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTalentWipeConfirmOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
@@ -397,7 +397,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
spellInfo = actualSpellInfo;
}
Spell *spell = new Spell(mover, spellInfo, false);
Spell* spell = new Spell(mover, spellInfo, false);
spell->m_cast_count = castCount; // set count of casts
spell->prepare(&targets);
}
@@ -550,7 +550,7 @@ void WorldSession::HandleSpellClick(WorldPacket& recv_data)
recv_data >> guid;
// this will get something not in world. crash
Creature *unit = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
Creature* unit = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
if (!unit)
return;
@@ -42,7 +42,7 @@ void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recv_data)
void WorldSession::SendTaxiStatus(uint64 guid)
{
// cheating checks
Creature *unit = GetPlayer()->GetMap()->GetCreature(guid);
Creature* unit = GetPlayer()->GetMap()->GetCreature(guid);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSession::SendTaxiStatus - Unit (GUID: %u) not found.", uint32(GUID_LOPART(guid)));
@@ -72,7 +72,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data)
recv_data >> guid;
// cheating checks
Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER);
if (!unit)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTaxiQueryAvailableNodes - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid)));
@@ -419,7 +419,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
// check item enchant aura cast
if (!amount && caster)
if (uint64 itemGUID = GetBase()->GetCastItemGUID())
if (Player *playerCaster = dynamic_cast<Player*>(caster))
if (Player* playerCaster = dynamic_cast<Player*>(caster))
if (Item *castItem = playerCaster->GetItemByGuid(itemGUID))
if (castItem->GetItemSuffixFactor())
{
@@ -6378,7 +6378,7 @@ void AuraEffect::HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mod
return;
Player *plCaster = caster->ToPlayer();
Unit *target = aurApp->GetTarget();
Unit* target = aurApp->GetTarget();
if (target->getDeathState() != JUST_DIED)
return;
+2 -2
View File
@@ -1416,7 +1416,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
if (caster->GetTypeId() != TYPEID_PLAYER)
break;
Player *player = caster->ToPlayer();
Player* player = caster->ToPlayer();
// Glyph of Guardian Spirit
if (AuraEffect * aurEff = player->GetAuraEffect(63231, 0))
{
@@ -1678,7 +1678,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
}
}
bool Aura::CanBeAppliedOn(Unit *target)
bool Aura::CanBeAppliedOn(Unit* target)
{
// unit not in world or during remove from world
if (!target->IsInWorld() || target->IsDuringRemoveFromWorld())
+17 -17
View File
@@ -91,7 +91,7 @@ SpellCastTargets::~SpellCastTargets()
{
}
void SpellCastTargets::setUnitTarget(Unit *target)
void SpellCastTargets::setUnitTarget(Unit* target)
{
if (!target)
return;
@@ -223,7 +223,7 @@ void SpellCastTargets::Update(Unit* caster)
m_itemTarget = NULL;
if (caster->GetTypeId() == TYPEID_PLAYER)
{
Player *player = caster->ToPlayer();
Player* player = caster->ToPlayer();
if (m_targetMask & TARGET_FLAG_ITEM)
m_itemTarget = player->GetItemByGuid(m_itemTargetGUID);
else if (m_targetMask & TARGET_FLAG_TRADE_ITEM)
@@ -1762,7 +1762,7 @@ void Spell::SearchAreaTarget(std::list<Unit*> &TagUnitMap, float radius, SpellNo
break;
case PUSH_CHAIN:
{
Unit *target = m_targets.getUnitTarget();
Unit* target = m_targets.getUnitTarget();
if (!target)
{
sLog->outError("SPELL: cannot find unit target for spell ID %u\n", m_spellInfo->Id);
@@ -1893,7 +1893,7 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType, Spe
default:
case SPELL_TARGETS_ENEMY:
{
Unit *target = NULL;
Unit* target = NULL;
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, range);
Trinity::UnitLastSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(m_caster, target, u_check);
m_caster->VisitNearbyObject(range, searcher);
@@ -1901,7 +1901,7 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType, Spe
}
case SPELL_TARGETS_ALLY:
{
Unit *target = NULL;
Unit* target = NULL;
Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, range);
Trinity::UnitLastSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(m_caster, target, u_check);
m_caster->VisitNearbyObject(range, searcher);
@@ -1975,7 +1975,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
case TARGET_TYPE_UNIT_TARGET:
{
Unit *target = m_targets.getUnitTarget();
Unit* target = m_targets.getUnitTarget();
if (!target)
{
sLog->outError("SPELL: no unit target for spell ID %u", m_spellInfo->Id);
@@ -2129,7 +2129,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
case TARGET_TYPE_DEST_TARGET: //2+8+2
{
Unit *target = m_targets.getUnitTarget();
Unit* target = m_targets.getUnitTarget();
if (!target)
{
sLog->outError("SPELL: no unit target for spell ID %u", m_spellInfo->Id);
@@ -2229,7 +2229,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
else
{
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id);
Unit *target = NULL;
Unit* target = NULL;
if (uint64 guid = m_caster->GetUInt64Value(UNIT_FIELD_TARGET))
target = ObjectAccessor::GetUnit(*m_caster, guid);
m_targets.setDst(target ? *target : *m_caster);
@@ -2314,7 +2314,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur)
if (pushType == PUSH_CHAIN) // Chain
{
Unit *target = m_targets.getUnitTarget();
Unit* target = m_targets.getUnitTarget();
if (!target)
{
sLog->outError("SPELL: no chain unit target for spell ID %u", m_spellInfo->Id);
@@ -2747,7 +2747,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
if (!m_targets.getUnitTargetGUID() && m_spellInfo->Targets & TARGET_FLAG_UNIT)
{
Unit *target = NULL;
Unit* target = NULL;
if (m_caster->GetTypeId() == TYPEID_UNIT)
target = m_caster->getVictim();
else
@@ -2780,7 +2780,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
if (!m_targets.HasDst() && m_spellInfo->Targets & TARGET_FLAG_DEST_LOCATION)
{
Unit *target = m_targets.getUnitTarget();
Unit* target = m_targets.getUnitTarget();
if (!target)
{
if (m_caster->GetTypeId() == TYPEID_UNIT)
@@ -2987,7 +2987,7 @@ void Spell::cast(bool skipCheck)
// update pointers base at GUIDs to prevent access to non-existed already object
UpdatePointers();
if (Unit *target = m_targets.getUnitTarget())
if (Unit* target = m_targets.getUnitTarget())
{
// three check: prepare, cast (m_casttime > 0), hit (delayed)
if (m_casttime && target->isAlive() && !target->IsFriendlyTo(m_caster) && !m_caster->canSeeOrDetect(target))
@@ -3010,7 +3010,7 @@ void Spell::cast(bool skipCheck)
// now that we've done the basic check, now run the scripts
// should be done before the spell is actually executed
if (Player *playerCaster = m_caster->ToPlayer())
if (Player* playerCaster = m_caster->ToPlayer())
sScriptMgr->OnPlayerSpellCast(playerCaster, this, skipCheck);
SetExecutedCurrently(true);
@@ -4700,7 +4700,7 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_MOVING;
}
Unit *target = m_targets.getUnitTarget();
Unit* target = m_targets.getUnitTarget();
// In pure self-cast spells, the client won't send any unit target
if (!target && (m_targets.getTargetMask() == TARGET_FLAG_SELF || m_targets.getTargetMask() & TARGET_FLAG_UNIT_CASTER)) // TARGET_FLAG_SELF == 0, remember!
@@ -4757,7 +4757,7 @@ SpellCastResult Spell::CheckCast(bool strict)
{
if (target->GetTypeId() == TYPEID_PLAYER)
{
Player *player = target->ToPlayer();
Player* player = target->ToPlayer();
if (!player->GetWeaponForAttack(BASE_ATTACK) || !player->IsUseEquipedWeapon(true))
return SPELL_FAILED_TARGET_NO_WEAPONS;
}
@@ -5408,7 +5408,7 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_ALREADY_HAVE_CHARM;
}
if (Unit *target = m_targets.getUnitTarget())
if (Unit* target = m_targets.getUnitTarget())
{
if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->IsVehicle())
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
@@ -5724,7 +5724,7 @@ SpellCastResult Spell::CheckRange(bool strict)
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex);
Unit *target = m_targets.getUnitTarget();
Unit* target = m_targets.getUnitTarget();
float max_range = (float)m_caster->GetSpellMaxRangeForTarget(target, srange);
float min_range = (float)m_caster->GetSpellMinRangeForTarget(target, srange);
uint32 range_type = GetSpellRangeType(srange);
+9 -9
View File
@@ -1007,7 +1007,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
Player *player = (Player*)m_caster;
Player* player = (Player*)m_caster;
if (player && player->GetQuestStatus(11379) == QUEST_STATUS_INCOMPLETE)
{
@@ -1157,7 +1157,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
// use 99 because it is 3d search
SearchAreaTarget(unitList, 99, PUSH_DST_CENTER, SPELL_TARGETS_ENTRY, 33114);
float minDist = 99 * 99;
Unit *target = NULL;
Unit* target = NULL;
for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
{
if (Vehicle *seat = (*itr)->GetVehicleKit())
@@ -2860,7 +2860,7 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
Player *player = (Player*)m_caster;
Player* player = (Player*)m_caster;
// applied only to using item
if (!m_CastItem)
@@ -3135,7 +3135,7 @@ void Spell::EffectLearnSpell(SpellEffIndex effIndex)
return;
}
Player *player = (Player*)unitTarget;
Player* player = (Player*)unitTarget;
uint32 spellToLearn = (m_spellInfo->Id == 483 || m_spellInfo->Id == 55884) ? damage : m_spellInfo->EffectTriggerSpell[effIndex];
player->learnSpell(spellToLearn, false);
@@ -3609,7 +3609,7 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)
{
if (item->IsFitToSpellRequirements(m_spellInfo))
{
Spell *spell = new Spell(m_caster, spellInfo, true);
Spell* spell = new Spell(m_caster, spellInfo, true);
SpellCastTargets targets;
targets.setItemTarget(item);
spell->prepare(&targets);
@@ -5547,7 +5547,7 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex)
if (m_caster->GetTypeId() != TYPEID_PLAYER || m_glyphIndex >= MAX_GLYPH_SLOT_INDEX)
return;
Player *player = (Player*)m_caster;
Player* player = (Player*)m_caster;
// glyph sockets level requirement
uint8 minLevel = 0;
@@ -5660,7 +5660,7 @@ void Spell::EffectInebriate(SpellEffIndex /*effIndex*/)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
Player *player = (Player*)unitTarget;
Player* player = (Player*)unitTarget;
uint16 currentDrunk = player->GetDrunkValue();
uint16 drunkMod = damage * 256;
if (currentDrunk + drunkMod > 0xFFFF)
@@ -5984,7 +5984,7 @@ void Spell::EffectSkinning(SpellEffIndex /*effIndex*/)
void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
{
Unit *target = m_targets.getUnitTarget();
Unit* target = m_targets.getUnitTarget();
if (!target)
return;
@@ -7039,7 +7039,7 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/)
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
Player *player = m_caster->ToPlayer();
Player* player = m_caster->ToPlayer();
if (!player)
return;
+1 -1
View File
@@ -320,7 +320,7 @@ void CreatureTextMgr::SendChatPacket(WorldPacket* data, WorldObject* source, Cha
{
if (range == TEXT_RANGE_NORMAL)//ignores team and gmOnly
{
Player *player = sObjectMgr->GetPlayer(whisperGuid);
Player* player = sObjectMgr->GetPlayer(whisperGuid);
if (!player || !player->GetSession())
return;
player->GetSession()->SendPacket(data);
+2 -2
View File
@@ -189,7 +189,7 @@ bool Weather::ReGenerate()
return m_type != old_type || m_grade != old_grade;
}
void Weather::SendWeatherUpdateToPlayer(Player *player)
void Weather::SendWeatherUpdateToPlayer(Player* player)
{
WorldPacket data(SMSG_WEATHER, (4+4+4));
@@ -197,7 +197,7 @@ void Weather::SendWeatherUpdateToPlayer(Player *player)
player->GetSession()->SendPacket(&data);
}
void Weather::SendFineWeatherUpdateToPlayer(Player *player)
void Weather::SendFineWeatherUpdateToPlayer(Player* player)
{
WorldPacket data(SMSG_WEATHER, (4+4+4));
+1 -1
View File
@@ -145,7 +145,7 @@ Player* World::FindPlayerInZone(uint32 zone)
if (!itr->second)
continue;
Player *player = itr->second->GetPlayer();
Player* player = itr->second->GetPlayer();
if (!player)
continue;
+1 -1
View File
@@ -250,7 +250,7 @@ public:
static bool HandleDebugSendOpcodeCommand(ChatHandler* handler, const char* /*args*/)
{
Unit *unit = handler->getSelectedUnit();
Player *player = NULL;
Player* player = NULL;
if (!unit || (unit->GetTypeId() != TYPEID_PLAYER))
player = handler->GetSession()->GetPlayer();
else
+1 -1
View File
@@ -75,7 +75,7 @@ public:
}
static bool HandleHonorAddKillCommand(ChatHandler* handler, const char* /*args*/)
{
Unit *target = handler->getSelectedUnit();
Unit* target = handler->getSelectedUnit();
if (!target)
{
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
+3 -3
View File
@@ -495,7 +495,7 @@ public:
//npc follow handling
static bool HandleNpcFollowCommand(ChatHandler* handler, const char* /*args*/)
{
Player *player = handler->GetSession()->GetPlayer();
Player* player = handler->GetSession()->GetPlayer();
Creature *creature = handler->getSelectedCreature();
if (!creature)
@@ -986,7 +986,7 @@ public:
//npc unfollow handling
static bool HandleNpcUnFollowCommand(ChatHandler* handler, const char* /*args*/)
{
Player *player = handler->GetSession()->GetPlayer();
Player* player = handler->GetSession()->GetPlayer();
Creature *creature = handler->getSelectedCreature();
if (!creature)
@@ -1101,7 +1101,7 @@ public:
return false;
}
Player *player = handler->GetSession()->GetPlayer ();
Player* player = handler->GetSession()->GetPlayer ();
if (player->GetPetGUID ())
{
+2 -2
View File
@@ -57,7 +57,7 @@ public:
if (!*args)
return false;
Player *player = handler->GetSession()->GetPlayer();
Player* player = handler->GetSession()->GetPlayer();
if (!player)
return false;
@@ -187,7 +187,7 @@ public:
if (!*args)
return false;
Player *player = handler->getSelectedPlayer();
Player* player = handler->getSelectedPlayer();
if (!player)
{
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
@@ -710,7 +710,7 @@ public:
me->EnterVehicle(deathcharger);
}
void JustDied(Unit *killer)
void JustDied(Unit* killer)
{
Creature* deathcharger = me->FindNearestCreature(28782, 30);
if (!deathcharger) return;
@@ -97,7 +97,7 @@ public:
{
if (me->getVictim()->GetTypeId() == TYPEID_PLAYER)
{
Unit *victim = me->getVictim();
Unit* victim = me->getVictim();
if (CAST_PLR(victim)->GetTeam() == HORDE)
{
me->CombatStop();
@@ -134,7 +134,7 @@ public:
}
}
void JustDied(Unit *victim)
void JustDied(Unit* victim)
{
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
@@ -334,7 +334,7 @@ public:
++SoulChargeCount;
}
void JustDied(Unit *victim)
void JustDied(Unit* victim)
{
hyjal_trashAI::JustDied(victim);
DoScriptText(SAY_DEATH, me);
@@ -127,7 +127,7 @@ public:
}
}
void JustDied(Unit *victim)
void JustDied(Unit* victim)
{
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
@@ -122,7 +122,7 @@ public:
}
}
void JustDied(Unit *victim)
void JustDied(Unit* victim)
{
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
@@ -118,7 +118,7 @@ public:
}
}
void JustDied(Unit *victim)
void JustDied(Unit* victim)
{
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
@@ -1315,7 +1315,7 @@ public:
}
}
void JustDied(Unit *victim)
void JustDied(Unit* victim)
{
float x, y, z;
me->GetPosition(x, y, z);
@@ -317,7 +317,7 @@ public:
pInstance->SetData(0, NOT_STARTED);*/
}
void AttackStart(Unit *victim)
void AttackStart(Unit* victim)
{
AttackStartCaster(victim, 10);//keep back & toss bombs/shoot
}
@@ -182,7 +182,7 @@ public:
switch(uiImpalePhase)
{
case IMPALE_PHASE_TARGET:
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
if (Creature *pImpaleTarget = DoSummonImpaleTarget(target))
pImpaleTarget->CastSpell(pImpaleTarget, SPELL_IMPALE_SHAKEGROUND, true);
@@ -312,7 +312,7 @@ public:
if (uiPoundTimer <= diff)
{
if (Unit *target = me->getVictim())
if (Unit* target = me->getVictim())
{
if (Creature *pImpaleTarget = DoSummonImpaleTarget(target))
me->CastSpell(pImpaleTarget, DUNGEON_MODE(SPELL_POUND, SPELL_POUND_H), false);
@@ -183,7 +183,7 @@ public:
uiDeathTimer = 30*IN_MILLISECONDS;
}
void JustDied(Unit *killer)
void JustDied(Unit* killer)
{
if (!killer)
return;
@@ -381,7 +381,7 @@ struct boss_faction_championsAI : public ScriptedAI
{
std::list<HostileReference*> const& tList = me->getThreatManager().getThreatList();
std::list<HostileReference*>::const_iterator iter;
Unit *target;
Unit* target;
for (iter = tList.begin(); iter!=tList.end(); ++iter)
{
target = Unit::GetUnit((*me), (*iter)->getUnitGuid());
@@ -396,7 +396,7 @@ struct boss_faction_championsAI : public ScriptedAI
std::list<HostileReference*> const& tList = me->getThreatManager().getThreatList();
std::list<HostileReference*>::const_iterator iter;
uint32 count = 0;
Unit *target;
Unit* target;
for (iter = tList.begin(); iter!=tList.end(); ++iter)
{
target = Unit::GetUnit((*me), (*iter)->getUnitGuid());
@@ -166,7 +166,7 @@ class boss_devourer_of_souls : public CreatureScript
{
if (mirroredSoulTarget && me->HasAura(SPELL_MIRRORED_SOUL))
{
if (Player *player = Unit::GetPlayer(*me, mirroredSoulTarget))
if (Player* player = Unit::GetPlayer(*me, mirroredSoulTarget))
{
if (player->GetAura(SPELL_MIRRORED_SOUL))
{
@@ -240,7 +240,7 @@ class boss_tyrannus : public CreatureScript
events.ScheduleEvent(EVENT_MARK_OF_RIMEFANG, urand(25000, 27000));
break;
case EVENT_OVERLORD_BRAND:
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
DoCast(target, SPELL_OVERLORD_BRAND);
events.ScheduleEvent(EVENT_OVERLORD_BRAND, urand(11000, 12000));
break;
@@ -283,7 +283,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
me->SetFlying(false);
me->SendMovementFlagUpdate();
me->SetReactState(REACT_AGGRESSIVE);
if (Unit *victim = me->SelectVictim())
if (Unit* victim = me->SelectVictim())
AttackStart(victim);
events.ScheduleEvent(EVENT_BLOOD_MIRROR, 2500, EVENT_GROUP_CANCELLABLE);
break;
@@ -791,7 +791,7 @@ class npc_rimefang : public CreatureScript
}
_events.ScheduleEvent(EVENT_ICY_BLAST_CAST, 3000);
}
else if (Unit *victim = me->SelectVictim())
else if (Unit* victim = me->SelectVictim())
{
me->SetReactState(REACT_DEFENSIVE);
AttackStart(victim);
@@ -167,14 +167,14 @@ public:
{
victimGUID = guid;
if (me->m_spells[0] && victimGUID)
if (Unit *victim = Unit::GetUnit(*me, victimGUID))
if (Unit* victim = Unit::GetUnit(*me, victimGUID))
victim->CastSpell(victim, me->m_spells[0], true, NULL, NULL, me->GetGUID());
}
void JustDied(Unit* /*killer*/)
{
if (me->m_spells[0] && victimGUID)
if (Unit *victim = Unit::GetUnit(*me, victimGUID))
if (Unit* victim = Unit::GetUnit(*me, victimGUID))
victim->RemoveAurasDueToSpell(me->m_spells[0], me->GetGUID());
}
};
@@ -89,7 +89,7 @@ public:
void AttackStart(Unit* /*who*/) {}
void MoveInLineOfSight(Unit* /*who*/) {}
void JustDied(Unit *killer)
void JustDied(Unit* killer)
{
if (killer->GetGUID() != me->GetGUID())
ShatterFrostTomb = true;
@@ -304,7 +304,7 @@ public:
if (pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
{
Unit *victim = NULL;
Unit* victim = NULL;
victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
if (victim)
me->getThreatManager().addThreat(victim, 1);
@@ -738,7 +738,7 @@ public:
if (!me->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER))
{
Unit *victim = NULL;
Unit* victim = NULL;
victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER));
if (victim)
AttackStart(victim);
@@ -262,7 +262,7 @@ class boss_vazruden : public CreatureScript
if (Revenge_Timer <= diff)
{
if (Unit *victim = me->getVictim())
if (Unit* victim = me->getVictim())
DoCast(victim, DUNGEON_MODE(SPELL_REVENGE, SPELL_REVENGE_H));
Revenge_Timer = 5000;
}
@@ -493,7 +493,7 @@ class mob_hellfire_sentry : public CreatureScript
if (KidneyShot_Timer <= diff)
{
if (Unit *victim = me->getVictim())
if (Unit* victim = me->getVictim())
DoCast(victim, SPELL_KIDNEY_SHOT);
KidneyShot_Timer = 20000;
}
+4 -4
View File
@@ -55,14 +55,14 @@ public:
}
}
void OnChat(Player *player, uint32 /*type*/, uint32 /*lang*/, std::string& msg, Player *receiver)
void OnChat(Player* player, uint32 /*type*/, uint32 /*lang*/, std::string& msg, Player* receiver)
{
if (sWorld->getBoolConfig(CONFIG_CHATLOG_WHISPER))
sLog->outChat("[WHISPER] Player %s tells %s: %s",
player->GetName(), receiver ? receiver->GetName() : "<unknown>", msg.c_str());
}
void OnChat(Player *player, uint32 type, uint32 /*lang*/, std::string& msg, Group *group)
void OnChat(Player* player, uint32 type, uint32 /*lang*/, std::string& msg, Group* group)
{
switch (type)
{
@@ -110,7 +110,7 @@ public:
}
}
void OnChat(Player *player, uint32 type, uint32 lang, std::string& msg, Guild *guild)
void OnChat(Player* player, uint32 type, uint32 lang, std::string& msg, Guild* guild)
{
switch(type)
{
@@ -131,7 +131,7 @@ public:
}
}
void OnChat(Player *player, uint32 /*type*/, uint32 /*lang*/, std::string& msg, Channel *channel)
void OnChat(Player* player, uint32 /*type*/, uint32 /*lang*/, std::string& msg, Channel* channel)
{
bool isSystem = channel &&
(channel->HasFlag(CHANNEL_FLAG_TRADE) ||
@@ -211,7 +211,7 @@ public:
struct trigger_deathAI : public NullCreatureAI
{
trigger_deathAI(Creature* c) : NullCreatureAI(c) {}
void JustDied(Unit *killer)
void JustDied(Unit* killer)
{
if (me->m_spells[0])
me->CastSpell(killer, me->m_spells[0], true);
@@ -447,7 +447,7 @@ bool ChatHandler::HandleCharacterEraseCommand(const char* args){
uint64 character_guid;
uint32 account_id;
Player *player = sObjectMgr->GetPlayer(character_name.c_str());
Player* player = sObjectMgr->GetPlayer(character_name.c_str());
if (player)
{
character_guid = player->GetGUID();