This commit is contained in:
sorvani committed 2014-03-05 22:19:55 -06:00
1 parent 822a1b1003
commit b0e24b346e
2 files changed
+3 -1

No files matched your search

+2 -1
View File
@@ -2522,10 +2522,11 @@ bool Database::GetUnusedInstanceID(uint16 &instance_id)
safe_delete_array(query);
if (mysql_num_rows(result) != 0) {
row = mysql_fetch_row(result);
mysql_free_result(result);
if(atoi(row[0]) <= max) {
count = atoi(row[0]);
mysql_free_result(result);
} else {
mysql_free_result(result);
if (RunQuery(query, MakeAnyLenString(&query, "SELECT id FROM instance_list where id > %u ORDER BY id", count), errbuf, &result)) {
safe_delete_array(query);
if (mysql_num_rows(result) != 0) {