mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 19:37:01 +00:00
[10126] Code style cleanup in Level2&3.cpp
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
9379e3b81d
commit
c0f549244b
3 changed files with 389 additions and 389 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -2468,16 +2468,16 @@ bool ChatHandler::HandleListItemCommand(const char* args)
|
||||||
|
|
||||||
bool ChatHandler::HandleListObjectCommand(const char* args)
|
bool ChatHandler::HandleListObjectCommand(const char* args)
|
||||||
{
|
{
|
||||||
if(!*args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r
|
// number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r
|
||||||
char* cId = extractKeyFromLink((char*)args,"Hgameobject_entry");
|
char* cId = extractKeyFromLink((char*)args, "Hgameobject_entry");
|
||||||
if(!cId)
|
if (!cId)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 go_id = atol(cId);
|
uint32 go_id = atol(cId);
|
||||||
if(!go_id)
|
if (!go_id)
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id);
|
PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -2485,7 +2485,7 @@ bool ChatHandler::HandleListObjectCommand(const char* args)
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObjectInfo const * gInfo = ObjectMgr::GetGameObjectInfo(go_id);
|
GameObjectInfo const * gInfo = ObjectMgr::GetGameObjectInfo(go_id);
|
||||||
if(!gInfo)
|
if (!gInfo)
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id);
|
PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, go_id);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -2495,20 +2495,20 @@ bool ChatHandler::HandleListObjectCommand(const char* args)
|
||||||
char* c_count = strtok(NULL, " ");
|
char* c_count = strtok(NULL, " ");
|
||||||
int count = c_count ? atol(c_count) : 10;
|
int count = c_count ? atol(c_count) : 10;
|
||||||
|
|
||||||
if(count < 0)
|
if (count < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QueryResult *result;
|
QueryResult *result;
|
||||||
|
|
||||||
uint32 obj_count = 0;
|
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)
|
if (result)
|
||||||
{
|
{
|
||||||
obj_count = (*result)[0].GetUInt32();
|
obj_count = (*result)[0].GetUInt32();
|
||||||
delete result;
|
delete result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_session)
|
if (m_session)
|
||||||
{
|
{
|
||||||
Player* pl = m_session->GetPlayer();
|
Player* pl = 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 gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
|
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 gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u",
|
||||||
|
|
@ -2538,22 +2538,22 @@ bool ChatHandler::HandleListObjectCommand(const char* args)
|
||||||
delete result;
|
delete result;
|
||||||
}
|
}
|
||||||
|
|
||||||
PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE,go_id,obj_count);
|
PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, go_id, obj_count);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChatHandler::HandleListCreatureCommand(const char* args)
|
bool ChatHandler::HandleListCreatureCommand(const char* args)
|
||||||
{
|
{
|
||||||
if(!*args)
|
if (!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r
|
// number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r
|
||||||
char* cId = extractKeyFromLink((char*)args,"Hcreature_entry");
|
char* cId = extractKeyFromLink((char*)args, "Hcreature_entry");
|
||||||
if(!cId)
|
if (!cId)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 cr_id = atol(cId);
|
uint32 cr_id = atol(cId);
|
||||||
if(!cr_id)
|
if (!cr_id)
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id);
|
PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -2561,7 +2561,7 @@ bool ChatHandler::HandleListCreatureCommand(const char* args)
|
||||||
}
|
}
|
||||||
|
|
||||||
CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(cr_id);
|
CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(cr_id);
|
||||||
if(!cInfo)
|
if (!cInfo)
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id);
|
PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, cr_id);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -2571,20 +2571,20 @@ bool ChatHandler::HandleListCreatureCommand(const char* args)
|
||||||
char* c_count = strtok(NULL, " ");
|
char* c_count = strtok(NULL, " ");
|
||||||
int count = c_count ? atol(c_count) : 10;
|
int count = c_count ? atol(c_count) : 10;
|
||||||
|
|
||||||
if(count < 0)
|
if (count < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QueryResult *result;
|
QueryResult *result;
|
||||||
|
|
||||||
uint32 cr_count = 0;
|
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)
|
if (result)
|
||||||
{
|
{
|
||||||
cr_count = (*result)[0].GetUInt32();
|
cr_count = (*result)[0].GetUInt32();
|
||||||
delete result;
|
delete result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_session)
|
if (m_session)
|
||||||
{
|
{
|
||||||
Player* pl = m_session->GetPlayer();
|
Player* pl = 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",
|
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",
|
||||||
|
|
@ -2614,7 +2614,7 @@ bool ChatHandler::HandleListCreatureCommand(const char* args)
|
||||||
delete result;
|
delete result;
|
||||||
}
|
}
|
||||||
|
|
||||||
PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE,cr_id,cr_count);
|
PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, cr_id, cr_count);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10125"
|
#define REVISION_NR "10126"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue