mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7493] Move .gobject functions in one place, update/fix security levels in code and mangos.sql.
This commit is contained in:
parent
bfa67880f2
commit
a63977d767
7 changed files with 557 additions and 547 deletions
|
|
@ -2368,47 +2368,6 @@ bool ChatHandler::HandleListObjectCommand(const char* args)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleGameObjectNearCommand(const char* args)
|
||||
{
|
||||
float distance = (!*args) ? 10 : atol(args);
|
||||
uint32 count = 0;
|
||||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
QueryResult *result = WorldDatabase.PQuery("SELECT guid, id, 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 map='%u' AND (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) <= '%f' ORDER BY order_",
|
||||
pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),
|
||||
pl->GetMapId(),pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),distance*distance);
|
||||
|
||||
if (result)
|
||||
{
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
uint32 guid = fields[0].GetUInt32();
|
||||
uint32 entry = fields[1].GetUInt32();
|
||||
float x = fields[2].GetFloat();
|
||||
float y = fields[3].GetFloat();
|
||||
float z = fields[4].GetFloat();
|
||||
int mapid = fields[5].GetUInt16();
|
||||
|
||||
GameObjectInfo const * gInfo = objmgr.GetGameObjectInfo(entry);
|
||||
|
||||
if(!gInfo)
|
||||
continue;
|
||||
|
||||
PSendSysMessage(LANG_GO_LIST_CHAT, guid, guid, gInfo->name, x, y, z, mapid);
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
delete result;
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_COMMAND_NEAROBJMESSAGE,distance,count);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleListCreatureCommand(const char* args)
|
||||
{
|
||||
if(!*args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue