Core: Codestyle clean-up
"pl"->"player" Note: codestyle methods needs maintained, Player* player. still to do properly clean-up chat.cpp.
This commit is contained in:
@@ -713,18 +713,18 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
|
||||
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* pl = itr->getSource();
|
||||
Player* player = itr->getSource();
|
||||
|
||||
if (!pl || pl == m_session->GetPlayer() || !pl->GetSession())
|
||||
if (!player || player == m_session->GetPlayer() || !player->GetSession())
|
||||
continue;
|
||||
|
||||
// check online security
|
||||
if (HasLowerSecurity(pl, 0))
|
||||
if (HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
std::string plNameLink = GetNameLink(pl);
|
||||
std::string plNameLink = GetNameLink(player);
|
||||
|
||||
if (pl->IsBeingTeleported() == true)
|
||||
if (player->IsBeingTeleported() == true)
|
||||
{
|
||||
PSendSysMessage(LANG_IS_TELEPORTED, plNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
@@ -733,7 +733,7 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
|
||||
|
||||
if (to_instance)
|
||||
{
|
||||
Map* plMap = pl->GetMap();
|
||||
Map* plMap = player->GetMap();
|
||||
|
||||
if (plMap->Instanceable() && plMap->GetInstanceId() != gmMap->GetInstanceId())
|
||||
{
|
||||
@@ -745,23 +745,23 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), "");
|
||||
if (needReportToTarget(pl))
|
||||
ChatHandler(pl).PSendSysMessage(LANG_SUMMONED_BY, GetNameLink().c_str());
|
||||
if (needReportToTarget(player))
|
||||
ChatHandler(player).PSendSysMessage(LANG_SUMMONED_BY, GetNameLink().c_str());
|
||||
|
||||
// stop flight if need
|
||||
if (pl->isInFlight())
|
||||
if (player->isInFlight())
|
||||
{
|
||||
pl->GetMotionMaster()->MovementExpired();
|
||||
pl->CleanupAfterTaxiFlight();
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
else
|
||||
pl->SaveRecallPosition();
|
||||
player->SaveRecallPosition();
|
||||
|
||||
// before GM
|
||||
float x, y, z;
|
||||
m_session->GetPlayer()->GetClosePoint(x, y, z, pl->GetObjectSize());
|
||||
pl->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, pl->GetOrientation());
|
||||
m_session->GetPlayer()->GetClosePoint(x, y, z, player->GetObjectSize());
|
||||
player->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, player->GetOrientation());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -256,10 +256,10 @@ bool ChatHandler::HandleAddItemCommand(const char *args)
|
||||
if (count == 0)
|
||||
count = 1;
|
||||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
Player* player = m_session->GetPlayer();
|
||||
Player* plTarget = getSelectedPlayer();
|
||||
if (!plTarget)
|
||||
plTarget = pl;
|
||||
plTarget = player;
|
||||
|
||||
sLog->outDetail(GetTrinityString(LANG_ADDITEM), itemId, count);
|
||||
|
||||
@@ -298,15 +298,15 @@ bool ChatHandler::HandleAddItemCommand(const char *args)
|
||||
Item* item = plTarget->StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId));
|
||||
|
||||
// remove binding (let GM give it to another player later)
|
||||
if (pl == plTarget)
|
||||
if (player == plTarget)
|
||||
for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr)
|
||||
if (Item* item1 = pl->GetItemByPos(itr->pos))
|
||||
if (Item* item1 = player->GetItemByPos(itr->pos))
|
||||
item1->SetBinding(false);
|
||||
|
||||
if (count > 0 && item)
|
||||
{
|
||||
pl->SendNewItem(item, count, false, true);
|
||||
if (pl != plTarget)
|
||||
player->SendNewItem(item, count, false, true);
|
||||
if (player != plTarget)
|
||||
plTarget->SendNewItem(item, count, true, false);
|
||||
}
|
||||
|
||||
@@ -637,9 +637,9 @@ bool ChatHandler::HandleListObjectCommand(const char *args)
|
||||
|
||||
if (m_session)
|
||||
{
|
||||
Player* pl = m_session->GetPlayer();
|
||||
Player* player = m_session->GetPlayer();
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
|
||||
pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), go_id, uint32(count));
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), go_id, uint32(count));
|
||||
}
|
||||
else
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '%u' LIMIT %u",
|
||||
@@ -709,9 +709,9 @@ bool ChatHandler::HandleListCreatureCommand(const char *args)
|
||||
|
||||
if (m_session)
|
||||
{
|
||||
Player* pl = m_session->GetPlayer();
|
||||
Player* player = m_session->GetPlayer();
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM creature WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
|
||||
pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), cr_id, uint32(count));
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), cr_id, uint32(count));
|
||||
}
|
||||
else
|
||||
result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '%u' LIMIT %u",
|
||||
@@ -3458,11 +3458,11 @@ bool ChatHandler::HandleBanListIPCommand(const char *args)
|
||||
|
||||
bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
|
||||
{
|
||||
Player* pl = m_session->GetPlayer();
|
||||
Player* player = m_session->GetPlayer();
|
||||
|
||||
// accept only explicitly selected target (not implicitly self targeting case)
|
||||
Unit* target = getSelectedUnit();
|
||||
if (pl->GetSelection() && target)
|
||||
if (player->GetSelection() && target)
|
||||
{
|
||||
if (target->GetTypeId() != TYPEID_UNIT || target->isPet())
|
||||
{
|
||||
@@ -3476,15 +3476,15 @@ bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(pl->GetPositionX(), pl->GetPositionY()));
|
||||
CellCoord p(Trinity::ComputeCellCoord(player->GetPositionX(), player->GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Trinity::RespawnDo u_do;
|
||||
Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(pl, u_do);
|
||||
Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(player, u_do);
|
||||
|
||||
TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
|
||||
cell.Visit(p, obj_worker, *pl->GetMap(), *pl, pl->GetGridActivationRange());
|
||||
cell.Visit(p, obj_worker, *player->GetMap(), *player, player->GetGridActivationRange());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -4031,9 +4031,9 @@ bool ChatHandler::HandleComeToMeCommand(const char *args)
|
||||
|
||||
caster->SetUnitMovementFlags(newFlags);
|
||||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
Player* player = m_session->GetPlayer();
|
||||
|
||||
caster->GetMotionMaster()->MovePoint(0, pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ());
|
||||
caster->GetMotionMaster()->MovePoint(0, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4177,9 +4177,9 @@ bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/)
|
||||
|
||||
bool ChatHandler::HandleInstanceSaveDataCommand(const char * /*args*/)
|
||||
{
|
||||
Player* pl = m_session->GetPlayer();
|
||||
Player* player = m_session->GetPlayer();
|
||||
|
||||
Map* map = pl->GetMap();
|
||||
Map* map = player->GetMap();
|
||||
if (!map->IsDungeon())
|
||||
{
|
||||
PSendSysMessage("Map is not a dungeon.");
|
||||
|
||||
Reference in New Issue
Block a user