Fixed a zone crash related to numhits for spells.

Fixed a query related to group leaders logging in.
Fixed a world crash related to attempting to join an adventure with Mercenaries.
This commit is contained in:
Trevius
2014-11-28 20:23:42 -06:00
parent b7c19e4034
commit 84fa042c75
5 changed files with 24 additions and 11 deletions
+5 -2
View File
@@ -768,7 +768,10 @@ uint32 Database::GetCharacterID(const char *name) {
std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name` = '%s'", name);
auto results = QueryDatabase(query);
auto row = results.begin();
if (row[0]){ return atoi(row[0]); }
if (results.RowCount() == 1)
{
return atoi(row[0]);
}
return 0;
}
@@ -3277,7 +3280,7 @@ char* Database::GetGroupLeaderForLogin(const char* name, char* leaderbuf) {
if (group_id == 0)
return leaderbuf;
query = StringFormat("SELECT `leadername` FROM `group_leader` WHERE `gid` = '%u' AND `groupid` = %u LIMIT 1", group_id);
query = StringFormat("SELECT `leadername` FROM `group_leaders` WHERE `gid` = '%u' LIMIT 1", group_id);
results = QueryDatabase(query);
for (auto row = results.begin(); row != results.end(); ++row)