fix(Scripts/Commands): cs_list crash (#10480)
* Update cs_list.cpp * This way? not tested * Update cs_list.cpp
This commit is contained in:
committed by
GitHub
parent
0b02ba87fc
commit
3f85eb9ac6
@@ -85,19 +85,19 @@ public:
|
|||||||
QueryResult result;
|
QueryResult result;
|
||||||
|
|
||||||
uint32 creatureCount = 0;
|
uint32 creatureCount = 0;
|
||||||
result = WorldDatabase.Query("SELECT COUNT(guid) FROM creature WHERE id='{}'", uint32(creatureId));
|
result = WorldDatabase.Query("SELECT COUNT(guid) FROM creature WHERE id1='{}' OR id2='{}' OR id3='{}'", uint32(creatureId), uint32(creatureId), uint32(creatureId));
|
||||||
if (result)
|
if (result)
|
||||||
creatureCount = (*result)[0].Get<uint64>();
|
creatureCount = (*result)[0].Get<uint64>();
|
||||||
|
|
||||||
if (handler->GetSession())
|
if (handler->GetSession())
|
||||||
{
|
{
|
||||||
Player* player = handler->GetSession()->GetPlayer();
|
Player* player = handler->GetSession()->GetPlayer();
|
||||||
result = WorldDatabase.Query("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '{}', 2) + POW(position_y - '{}', 2) + POW(position_z - '{}', 2)) AS order_ FROM creature WHERE id = '{}' ORDER BY order_ ASC LIMIT {}",
|
result = WorldDatabase.Query("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '{}', 2) + POW(position_y - '{}', 2) + POW(position_z - '{}', 2)) AS order_ FROM creature WHERE id1='{}' OR id2='{}' OR id3='{}' ORDER BY order_ ASC LIMIT {}",
|
||||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), uint32(creatureId), count);
|
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), uint32(creatureId), uint32(creatureId), uint32(creatureId), count);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
result = WorldDatabase.Query("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '{}' LIMIT {}",
|
result = WorldDatabase.Query("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id1='{}' OR id2='{}' OR id3='{}' LIMIT {}",
|
||||||
uint32(creatureId), count);
|
uint32(creatureId), uint32(creatureId), uint32(creatureId), count);
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user