mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Quest API] Add CheckNameFilter to Perl/Lua. (#2175)
- Add quest::checknamefilter(name) to Perl. - Add eq.check_name_filter(name) to Lua. - Allows operators to check strings against the name filter for stuff like setting custom pet names, titles, suffixes, etc in scripts.
This commit is contained in:
+10
-4
@@ -167,15 +167,21 @@ bool BotDatabase::LoadBotSpellCastingChances()
|
||||
/* Bot functions */
|
||||
bool BotDatabase::QueryNameAvailablity(const std::string& bot_name, bool& available_flag)
|
||||
{
|
||||
if (bot_name.empty() || bot_name.size() > 60 || !database.CheckUsedName(bot_name.c_str()))
|
||||
if (bot_name.empty() || bot_name.size() > 60 || !database.CheckUsedName(bot_name))
|
||||
return false;
|
||||
|
||||
query = StringFormat("SELECT `id` FROM `vw_bot_character_mobs` WHERE `name` LIKE '%s' LIMIT 1", bot_name.c_str());
|
||||
query = fmt::format(
|
||||
"SELECT `id` FROM `vw_bot_character_mobs` WHERE `name` LIKE '{}' LIMIT 1",
|
||||
bot_name
|
||||
);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success())
|
||||
if (!results.Success()) {
|
||||
return false;
|
||||
if (results.RowCount())
|
||||
}
|
||||
|
||||
if (results.RowCount()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
available_flag = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user