diff --git a/common/ruletypes.h b/common/ruletypes.h index 6c253722a..c3ba0c0e9 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -531,6 +531,7 @@ RULE_CATEGORY_END() #ifdef BOTS RULE_CATEGORY(Bots) RULE_INT(Bots, AAExpansion, 8) // Bots get AAs through this expansion +RULE_BOOL(Bots, AllowCamelCaseNames, false) // Allows the use of 'MyBot' type names RULE_INT(Bots, CommandSpellRank, 1) // Filters bot command spells by rank (1, 2 and 3 are valid filters - any other number allows all ranks) RULE_INT(Bots, CreationLimit, 150) // Number of bots that each account can create RULE_BOOL(Bots, FinishBuffing, false) // Allow for buffs to complete even if the bot caster is out of mana. Only affects buffing out of combat. diff --git a/common/version.h b/common/version.h index e5a4e6322..2b621b1c3 100644 --- a/common/version.h +++ b/common/version.h @@ -32,7 +32,7 @@ #define CURRENT_BINARY_DATABASE_VERSION 9096 #ifdef BOTS - #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9006 + #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9007 #else #define CURRENT_BINARY_BOTS_DATABASE_VERSION 0 // must be 0 #endif diff --git a/utils/sql/git/bots/bots_db_update_manifest.txt b/utils/sql/git/bots/bots_db_update_manifest.txt index 0bfabf0ff..cda433dc1 100644 --- a/utils/sql/git/bots/bots_db_update_manifest.txt +++ b/utils/sql/git/bots/bots_db_update_manifest.txt @@ -5,6 +5,7 @@ 9004|2016_04_07_bots_heal_override_target.sql|SELECT `bot_command` FROM `bot_command_settings` WHERE `bot_command` LIKE 'healrotationclearhot'|empty| 9005|2016_04_08_bots_heal_rotations.sql|SHOW TABLES LIKE 'bot_heal_rotations'|empty| 9006|2016_04_12_bots_inventory_window.sql|SELECT `bot_command` FROM `bot_command_settings` WHERE `bot_command` LIKE 'inventorywindow'|empty| +9007|2016_06_23_bots_camel_case_name_rule.sql|SELECT * FROM `rule_values` WHERE `rule_name` LIKE 'Bots:AllowCamelCaseNames'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/bots/required/2016_06_23_bots_camel_case_name_rule.sql b/utils/sql/git/bots/required/2016_06_23_bots_camel_case_name_rule.sql new file mode 100644 index 000000000..6a758f28a --- /dev/null +++ b/utils/sql/git/bots/required/2016_06_23_bots_camel_case_name_rule.sql @@ -0,0 +1,2 @@ +INSERT INTO `rule_values` (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES +(1, 'Bots:AllowCamelCaseNames', 'false', 'Allows the use of \'MyBot\' type names'); diff --git a/zone/bot.cpp b/zone/bot.cpp index edbc4e8eb..b4d0718be 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1538,7 +1538,7 @@ bool Bot::IsValidName(std::string& name) return false; for (int i = 1; i < name.length(); ++i) { - if (!islower(name[i]) && name[i] != '_') { + if ((!RuleB(Bots, AllowCamelCaseNames) && !islower(name[i])) && name[i] != '_') { return false; } }