mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
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;
|
||||
|
||||
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)
|
||||
creatureCount = (*result)[0].Get<uint64>();
|
||||
|
||||
if (handler->GetSession())
|
||||
{
|
||||
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 {}",
|
||||
player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), uint32(creatureId), count);
|
||||
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), uint32(creatureId), uint32(creatureId), count);
|
||||
}
|
||||
else
|
||||
result = WorldDatabase.Query("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '{}' LIMIT {}",
|
||||
uint32(creatureId), count);
|
||||
result = WorldDatabase.Query("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id1='{}' OR id2='{}' OR id3='{}' LIMIT {}",
|
||||
uint32(creatureId), uint32(creatureId), uint32(creatureId), count);
|
||||
|
||||
if (result)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user