[Hotfix] Instance GetUnusedInstanceID crash fox

This commit is contained in:
Akkadius 2023-08-20 21:30:37 -05:00
parent 7122ac33b2
commit 5d133a2b47

View File

@ -174,12 +174,12 @@ bool Database::GetUnusedInstanceID(uint16 &instance_id)
return true; return true;
} }
auto row = results.begin(); for (auto row : results) {
// check that id is within limits
// check that id is within limits if (row[0] && Strings::ToInt(row[0]) <= max_instance_id) {
if (Strings::ToInt(row[0]) <= max_instance_id) { instance_id = Strings::ToInt(row[0]);
instance_id = Strings::ToInt(row[0]); return true;
return true; }
} }
// unhandled situation - should not reach here // unhandled situation - should not reach here