fix strategies conflict for rndbot

This commit is contained in:
Yunfan Li
2023-07-30 14:33:52 +08:00
parent 944e0fa1ed
commit e93b1edcd5
17 changed files with 82 additions and 79 deletions

View File

@@ -227,6 +227,13 @@ std::string const RandomPlayerbotFactory::CreateRandomBotName(uint8 gender)
}
fields = result->Fetch();
std::string ret = fields[0].Get<std::string>();
// check name limitations
if (ObjectMgr::CheckPlayerName(ret) != CHAR_NAME_SUCCESS ||
(sObjectMgr->IsReservedName(ret) || sObjectMgr->IsProfanityName(ret)))
{
continue;
}
if (ret.size()) {
CharacterDatabase.DirectExecute("UPDATE playerbots_names SET in_use=1 WHERE name='{}'", ret);
}