mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-21 06:01:29 +00:00
UpdateName converted to StringFormat
This commit is contained in:
parent
57b11629ce
commit
8b3afbdf10
@ -1277,12 +1277,11 @@ void Database::ClearMerchantTemp(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Database::UpdateName(const char* oldname, const char* newname) {
|
bool Database::UpdateName(const char* oldname, const char* newname) {
|
||||||
char *query = nullptr;
|
|
||||||
|
|
||||||
std::cout << "Renaming " << oldname << " to " << newname << "..." << std::endl;
|
std::cout << "Renaming " << oldname << " to " << newname << "..." << std::endl;
|
||||||
|
|
||||||
auto results = QueryDatabase(query, MakeAnyLenString(&query, "UPDATE character_ SET name='%s' WHERE name='%s';", newname, oldname));
|
std::string query = StringFormat("UPDATE character_ SET name='%s' WHERE name='%s';", newname, oldname);
|
||||||
safe_delete_array(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user