CheckNameFilter converted to string

This commit is contained in:
Arthur Ice 2014-07-08 20:21:15 -07:00 committed by Arthur Ice
parent 4804cca0ab
commit d7a98e7655

View File

@ -1127,7 +1127,6 @@ uint8 Database::GetPEQZone(uint32 zoneID, uint32 version){
bool Database::CheckNameFilter(const char* name, bool surname) bool Database::CheckNameFilter(const char* name, bool surname)
{ {
std::string str_name = name; std::string str_name = name;
char *query = nullptr;
if(surname) if(surname)
{ {
@ -1178,16 +1177,16 @@ bool Database::CheckNameFilter(const char* name, bool surname)
} }
} }
auto results = QueryDatabase(query, MakeAnyLenString(&query, "SELECT name FROM name_filter"));
std::string query("SELECT name FROM name_filter");
auto results = QueryDatabase(query);
if (!results.Success()) if (!results.Success())
{ {
std::cerr << "Error in CheckNameFilter query '" << query << "' " << results.ErrorMessage() << std::endl; std::cerr << "Error in CheckNameFilter query '" << query << "' " << results.ErrorMessage() << std::endl;
safe_delete_array(query);
// false through to true? shouldn't it be falls through to false? // false through to true? shouldn't it be falls through to false?
return true; return true;
} }
safe_delete_array(query);
for (auto row = results.begin();row != results.end();++row) for (auto row = results.begin();row != results.end();++row)
{ {