mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Bug Fix] Fix Bot Creation Issue (#4235)
# Notes - Creating bots was failing because were checking for `false` on `Database::CheckUsedName()` in `BotDatabase::QueryNameAvailability`. - `Database::CheckUsedName()` is now `Database::IsNameUsed()` and checks for both bots and character name usages. - We were checking for `false` which was always happening when there were no entries for the supplied name, meaning we were never allowed to create a bot.
This commit is contained in:
@@ -6875,7 +6875,7 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app)
|
||||
Client *c = entity_list.GetClientByName(gmn->oldname);
|
||||
LogInfo("GM([{}]) changeing players name. Old:[{}] New:[{}]", GetName(), gmn->oldname, gmn->newname);
|
||||
|
||||
const bool used_name = database.CheckUsedName(gmn->newname);
|
||||
const bool used_name = database.IsNameUsed(gmn->newname);
|
||||
if (!c) {
|
||||
Message(Chat::Red, fmt::format("{} not found for name change. Operation failed!", gmn->oldname).c_str());
|
||||
return;
|
||||
@@ -6886,7 +6886,7 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!used_name) {
|
||||
if (used_name) {
|
||||
Message(Chat::Red, fmt::format("{} is already in use. Operation failed!", gmn->newname).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user