diff options
-rw-r--r-- | sql/updates/world/2015_04_05_05_world.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_gobject.cpp | 27 |
2 files changed, 17 insertions, 13 deletions
diff --git a/sql/updates/world/2015_04_05_05_world.sql b/sql/updates/world/2015_04_05_05_world.sql new file mode 100644 index 00000000000..af500e56263 --- /dev/null +++ b/sql/updates/world/2015_04_05_05_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `trinity_string` WHERE entry=524; +INSERT INTO trinity_string VALUES +(524,'Selected object:\n|cffffffff|Hgameobject:%llu|h[%s]|h|r GUID: %u ID: %u\nX: %f Y: %f Z: %f MapId: %u\nOrientation: %f\nPhaseId %u\nPhaseGroup %u',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 36876a9be34..7d356949d48 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -243,14 +243,14 @@ public: uint32 objectId = atoul(id); if (objectId) - result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE map = '%i' AND id = '%u' ORDER BY order_ ASC LIMIT 1", + result = WorldDatabase.PQuery("SELECT guid, id, position_x, position_y, position_z, orientation, map, PhaseId, PhaseGroup, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE map = '%i' AND id = '%u' ORDER BY order_ ASC LIMIT 1", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), objectId); else { std::string name = id; WorldDatabase.EscapeString(name); result = WorldDatabase.PQuery( - "SELECT guid, id, position_x, position_y, position_z, orientation, map, phaseMask, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ " + "SELECT guid, id, position_x, position_y, position_z, orientation, map, PhaseId, PhaseGroup, (POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ " "FROM gameobject, gameobject_template WHERE gameobject_template.entry = gameobject.id AND map = %i AND name " _LIKE_" " _CONCAT3_("'%%'", "'%s'", "'%%'")" ORDER BY order_ ASC LIMIT 1", player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), name.c_str()); } @@ -277,7 +277,7 @@ public: else eventFilter << ')'; - result = WorldDatabase.PQuery("SELECT gameobject.guid, id, position_x, position_y, position_z, orientation, map, phaseMask, " + result = WorldDatabase.PQuery("SELECT gameobject.guid, id, position_x, position_y, position_z, orientation, map, PhaseId, PhaseGroup, " "(POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ FROM gameobject " "LEFT OUTER JOIN game_event_gameobject on gameobject.guid = game_event_gameobject.guid WHERE map = '%i' %s ORDER BY order_ ASC LIMIT 10", handler->GetSession()->GetPlayer()->GetPositionX(), handler->GetSession()->GetPlayer()->GetPositionY(), handler->GetSession()->GetPlayer()->GetPositionZ(), @@ -293,21 +293,22 @@ public: bool found = false; float x, y, z, o; ObjectGuid::LowType guidLow; - uint32 id, phase; + uint32 id, phaseId, phaseGroup; uint16 mapId; uint32 poolId; do { Field* fields = result->Fetch(); - guidLow = fields[0].GetUInt64(); - id = fields[1].GetUInt32(); - x = fields[2].GetFloat(); - y = fields[3].GetFloat(); - z = fields[4].GetFloat(); - o = fields[5].GetFloat(); - mapId = fields[6].GetUInt16(); - phase = fields[7].GetUInt32(); + guidLow = fields[0].GetUInt64(); + id = fields[1].GetUInt32(); + x = fields[2].GetFloat(); + y = fields[3].GetFloat(); + z = fields[4].GetFloat(); + o = fields[5].GetFloat(); + mapId = fields[6].GetUInt16(); + phaseId = fields[7].GetUInt32(); + phaseGroup = fields[8].GetUInt32(); poolId = sPoolMgr->IsPartOfAPool<GameObject>(guidLow); if (!poolId || sPoolMgr->IsSpawnedObject<GameObject>(guidLow)) found = true; @@ -329,7 +330,7 @@ public: GameObject* target = handler->GetSession()->GetPlayer()->GetMap()->GetGameObject(ObjectGuid::Create<HighGuid::GameObject>(mapId, id, guidLow)); - handler->PSendSysMessage(LANG_GAMEOBJECT_DETAIL, guidLow, objectInfo->name.c_str(), guidLow, id, x, y, z, mapId, o, phase); + handler->PSendSysMessage(LANG_GAMEOBJECT_DETAIL, guidLow, objectInfo->name.c_str(), guidLow, id, x, y, z, mapId, o, phaseId, phaseGroup); if (target) { |