[Cleanup] Remove bool return from GetSharedPlatinum() (#3191)

# Notes
- This was returning `false` and implicitly converting it to an integer.
This commit is contained in:
Alex King 2023-04-05 11:22:23 -04:00 committed by GitHub
parent 457ce85746
commit 8afbc585da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -425,17 +425,13 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) {
int32 SharedDatabase::GetSharedPlatinum(uint32 account_id)
{
const std::string query = StringFormat("SELECT sharedplat FROM account WHERE id = '%i'", account_id);
auto results = QueryDatabase(query);
if (!results.Success()) {
return false;
}
if (results.RowCount() != 1)
return 0;
auto& row = results.begin();
const auto query = fmt::format("SELECT sharedplat FROM account WHERE id = {}", account_id);
auto results = QueryDatabase(query);
if (!results.Success() || !results.RowCount()) {
return 0;
}
auto row = results.begin();
return Strings::ToInt(row[0]);
}