Core/Game: Code style and remove unused core.
Signed-off-by: Gyx <[email protected]>
This commit is contained in:
@@ -70,11 +70,11 @@ bool ChatHandler::HandleStartCommand(const char* /*args*/)
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((chr->isDead()) || (chr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)))
|
||||
if (chr->isDead() || chr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
{
|
||||
// if player is dead and stuck, send ghost to graveyard
|
||||
chr->RepopAtGraveyard();
|
||||
return true;
|
||||
// if player is dead and stuck, send ghost to graveyard
|
||||
chr->RepopAtGraveyard();
|
||||
return true;
|
||||
}
|
||||
|
||||
// cast spell Stuck
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
|
||||
bool ChatHandler::HandleNameAnnounceCommand(const char* args)
|
||||
{
|
||||
WorldPacket data;
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
@@ -56,7 +55,6 @@ bool ChatHandler::HandleNameAnnounceCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleGMNameAnnounceCommand(const char* args)
|
||||
{
|
||||
WorldPacket data;
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
@@ -422,13 +420,10 @@ bool ChatHandler::HandleTaxiCheatCommand(const char* args)
|
||||
std::string argstr = (char*)args;
|
||||
|
||||
Player* chr = getSelectedPlayer();
|
||||
if (!chr)
|
||||
{
|
||||
chr=m_session->GetPlayer();
|
||||
}
|
||||
|
||||
// check online security
|
||||
else if (HasLowerSecurity(chr, 0))
|
||||
if (!chr)
|
||||
chr = m_session->GetPlayer();
|
||||
else if (HasLowerSecurity(chr, 0)) // check online security
|
||||
return false;
|
||||
|
||||
if (argstr == "on")
|
||||
@@ -474,12 +469,12 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
|
||||
wstrToLower (wnamepart);
|
||||
|
||||
// Search in AreaTable.dbc
|
||||
for (uint32 areaflag = 0; areaflag < sAreaStore.GetNumRows (); ++areaflag)
|
||||
for (uint32 areaflag = 0; areaflag < sAreaStore.GetNumRows(); ++areaflag)
|
||||
{
|
||||
AreaTableEntry const* areaEntry = sAreaStore.LookupEntry (areaflag);
|
||||
AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(areaflag);
|
||||
if (areaEntry)
|
||||
{
|
||||
int loc = GetSessionDbcLocale ();
|
||||
int loc = GetSessionDbcLocale();
|
||||
std::string name = areaEntry->area_name[loc];
|
||||
if (name.empty())
|
||||
continue;
|
||||
@@ -489,7 +484,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
|
||||
loc = 0;
|
||||
for (; loc < TOTAL_LOCALES; ++loc)
|
||||
{
|
||||
if (loc == GetSessionDbcLocale ())
|
||||
if (loc == GetSessionDbcLocale())
|
||||
continue;
|
||||
|
||||
name = areaEntry->area_name[loc];
|
||||
|
||||
@@ -175,7 +175,6 @@ bool ChatHandler::HandleItemMoveCommand(const char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
uint8 srcslot, dstslot;
|
||||
|
||||
char* pParam1 = strtok((char*)args, " ");
|
||||
if (!pParam1)
|
||||
@@ -185,8 +184,8 @@ bool ChatHandler::HandleItemMoveCommand(const char* args)
|
||||
if (!pParam2)
|
||||
return false;
|
||||
|
||||
srcslot = (uint8)atoi(pParam1);
|
||||
dstslot = (uint8)atoi(pParam2);
|
||||
uint8 srcslot = (uint8)atoi(pParam1);
|
||||
uint8 dstslot = (uint8)atoi(pParam2);
|
||||
|
||||
if (srcslot == dstslot)
|
||||
return true;
|
||||
@@ -279,7 +278,6 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
uint32 areaId;
|
||||
uint32 phase = 0;
|
||||
|
||||
|
||||
// get additional information from Player object
|
||||
if (target)
|
||||
{
|
||||
@@ -756,7 +754,6 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
|
||||
{
|
||||
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
@@ -768,7 +765,7 @@ bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
|
||||
|
||||
QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE email = '%s'", email.c_str ());
|
||||
|
||||
return LookupPlayerSearchCommand (result, limit);
|
||||
return LookupPlayerSearchCommand(result, limit);
|
||||
}
|
||||
|
||||
bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit)
|
||||
|
||||
@@ -87,11 +87,10 @@ bool ChatHandler::HandleSetSkillCommand(const char *args)
|
||||
return false;
|
||||
|
||||
char *level_p = strtok (NULL, " ");
|
||||
|
||||
if (!level_p)
|
||||
return false;
|
||||
|
||||
char *max_p = strtok (NULL, " ");
|
||||
char *max_p = strtok (NULL, " ");
|
||||
|
||||
int32 skill = atoi(skill_p);
|
||||
if (skill <= 0)
|
||||
@@ -128,7 +127,7 @@ bool ChatHandler::HandleSetSkillCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
int32 max = max_p ? atol (max_p) : target->GetPureMaxSkillValue(skill);
|
||||
int32 max = max_p ? atol (max_p) : target->GetPureMaxSkillValue(skill);
|
||||
|
||||
if (level <= 0 || level > max || max <= 0)
|
||||
return false;
|
||||
@@ -631,7 +630,7 @@ bool ChatHandler::HandleListObjectCommand(const char *args)
|
||||
QueryResult result;
|
||||
|
||||
uint32 obj_count = 0;
|
||||
result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", go_id);
|
||||
result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", go_id);
|
||||
if (result)
|
||||
obj_count = (*result)[0].GetUInt32();
|
||||
|
||||
@@ -703,7 +702,7 @@ bool ChatHandler::HandleListCreatureCommand(const char *args)
|
||||
QueryResult result;
|
||||
|
||||
uint32 cr_count = 0;
|
||||
result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", cr_id);
|
||||
result = WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", cr_id);
|
||||
if (result)
|
||||
cr_count = (*result)[0].GetUInt32();
|
||||
|
||||
@@ -2143,16 +2142,12 @@ bool ChatHandler::HandleExploreCheatCommand(const char *args)
|
||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, GetNameLink().c_str());
|
||||
}
|
||||
|
||||
for (uint8 i=0; i<PLAYER_EXPLORED_ZONES_SIZE; ++i)
|
||||
for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
|
||||
{
|
||||
if (flag != 0)
|
||||
{
|
||||
m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -2434,7 +2429,9 @@ bool ChatHandler::HandleListAurasCommand (const char * /*args*/)
|
||||
for (uint16 i = 0; i < TOTAL_AURAS; ++i)
|
||||
{
|
||||
Unit::AuraEffectList const& uAuraList = unit->GetAuraEffectsByType(AuraType(i));
|
||||
if (uAuraList.empty()) continue;
|
||||
if (uAuraList.empty())
|
||||
continue;
|
||||
|
||||
PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, uAuraList.size(), i);
|
||||
for (Unit::AuraEffectList::const_iterator itr = uAuraList.begin(); itr != uAuraList.end(); ++itr)
|
||||
{
|
||||
@@ -2739,7 +2736,7 @@ bool ChatHandler::HandleServerShutDownCommand(const char *args)
|
||||
if (exitcode < 0 || exitcode > 125)
|
||||
return false;
|
||||
|
||||
sWorld->ShutdownServ (time, 0, exitcode);
|
||||
sWorld->ShutdownServ(time, 0, exitcode);
|
||||
}
|
||||
else
|
||||
sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE);
|
||||
@@ -2774,7 +2771,7 @@ bool ChatHandler::HandleServerRestartCommand(const char *args)
|
||||
if (exitcode < 0 || exitcode > 125)
|
||||
return false;
|
||||
|
||||
sWorld->ShutdownServ (time, SHUTDOWN_MASK_RESTART, exitcode);
|
||||
sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitcode);
|
||||
}
|
||||
else
|
||||
sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
|
||||
@@ -2809,7 +2806,7 @@ bool ChatHandler::HandleServerIdleRestartCommand(const char *args)
|
||||
if (exitcode < 0 || exitcode > 125)
|
||||
return false;
|
||||
|
||||
sWorld->ShutdownServ (time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode);
|
||||
sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode);
|
||||
}
|
||||
else
|
||||
sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE);
|
||||
@@ -2844,7 +2841,7 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char *args)
|
||||
if (exitcode < 0 || exitcode > 125)
|
||||
return false;
|
||||
|
||||
sWorld->ShutdownServ (time, SHUTDOWN_MASK_IDLE, exitcode);
|
||||
sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitcode);
|
||||
}
|
||||
else
|
||||
sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE);
|
||||
@@ -4494,10 +4491,6 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args)
|
||||
return true;
|
||||
}
|
||||
|
||||
/*------------------------------------------
|
||||
*-------------TRINITY----------------------
|
||||
*-------------------------------------*/
|
||||
|
||||
bool ChatHandler::HandlePlayAllCommand(const char *args)
|
||||
{
|
||||
if (!*args)
|
||||
|
||||
Reference in New Issue
Block a user