From f34a9470a83832036c0f5c711b9f08b14085fbc1 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:23:40 -0600 Subject: [PATCH] code cleanup 4 --- zone/bot.cpp | 2 +- zone/bot_command.cpp | 2 +- zone/bot_command.h | 2 +- zone/bot_commands/appearance.cpp | 26 +++++++-------- zone/bot_commands/bot.cpp | 38 +++++++++++----------- zone/bot_commands/default_settings.cpp | 2 +- zone/bot_commands/heal_rotation.cpp | 44 +++++++++++++------------- zone/bot_commands/inventory.cpp | 12 +++---- zone/bot_commands/pet.cpp | 10 +++--- zone/bot_commands/sit_mana_percent.cpp | 2 +- zone/bot_database.cpp | 4 +-- 11 files changed, 72 insertions(+), 72 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 3f99c4cdb..3594adb4a 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -9562,7 +9562,7 @@ bool Bot::CastChecks(uint16 spell_id, Mob* tar, uint16 spell_type, bool precheck return false; } - if (!AECheck && !IsValidSpellRange(spell_id, tar)) { + if (!ae_check && !IsValidSpellRange(spell_id, tar)) { LogBotPreChecksDetail("{} says, 'Cancelling cast of {} on {} due to IsValidSpellRange.'", GetCleanName(), GetSpellName(spell_id), tar->GetCleanName()); return false; } diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 706a8c208..2ceb520bd 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -2037,7 +2037,7 @@ bool helper_no_available_bots(Client *bot_owner, Bot *my_bot) return false; } -void helper_send_available_subcommands(Client *bot_owner, const char* command_simile, const std::list& subcommand_list) +void helper_send_available_subcommands(Client* bot_owner, const char* command_simile, std::vector subcommand_list) { bot_owner->Message(Chat::White, "Available %s management subcommands:", command_simile); diff --git a/zone/bot_command.h b/zone/bot_command.h index b64dabbf9..1482bcc61 100644 --- a/zone/bot_command.h +++ b/zone/bot_command.h @@ -1802,7 +1802,7 @@ bool helper_command_alias_fail(Client *bot_owner, const char* command_handler, c void helper_command_depart_list(Client* bot_owner, Bot* druid_bot, Bot* wizard_bot, bcst_list* local_list, bool single_flag = false); bool helper_is_help_or_usage(const char* arg); bool helper_no_available_bots(Client *bot_owner, Bot *my_bot = nullptr); -void helper_send_available_subcommands(Client *bot_owner, const char* command_simile, const std::list& subcommand_list); +void helper_send_available_subcommands(Client *bot_owner, const char* command_simile, std::vector subcommand_list); void helper_send_usage_required_bots(Client *bot_owner, BCEnum::SpType spell_type, uint8 bot_class = Class::None); bool helper_spell_check_fail(STBaseEntry* local_entry); bool helper_spell_list_fail(Client *bot_owner, bcst_list* spell_list, BCEnum::SpType spell_type); diff --git a/zone/bot_commands/appearance.cpp b/zone/bot_commands/appearance.cpp index 9ca820e60..5b8d883cc 100644 --- a/zone/bot_commands/appearance.cpp +++ b/zone/bot_commands/appearance.cpp @@ -2,19 +2,19 @@ void bot_command_appearance(Client *c, const Seperator *sep) { - - std::list subcommand_list; - subcommand_list.push_back("botbeardcolor"); - subcommand_list.push_back("botbeardstyle"); - subcommand_list.push_back("botdetails"); - subcommand_list.push_back("botdyearmor"); - subcommand_list.push_back("boteyes"); - subcommand_list.push_back("botface"); - subcommand_list.push_back("bothaircolor"); - subcommand_list.push_back("bothairstyle"); - subcommand_list.push_back("botheritage"); - subcommand_list.push_back("bottattoo"); - subcommand_list.push_back("botwoad"); + std::vector subcommand_list = { + "botbeardcolor", + "botbeardstyle", + "botdetails", + "botdyearmor", + "boteyes", + "botface", + "bothaircolor", + "bothairstyle", + "botheritage", + "bottattoo", + "botwoad" + }; if (helper_command_alias_fail(c, "bot_command_appearance", sep->arg[0], "botappearance")) return; diff --git a/zone/bot_commands/bot.cpp b/zone/bot_commands/bot.cpp index 8654f5e69..ab5e036d3 100644 --- a/zone/bot_commands/bot.cpp +++ b/zone/bot_commands/bot.cpp @@ -2,25 +2,25 @@ void bot_command_bot(Client *c, const Seperator *sep) { - - std::list subcommand_list; - subcommand_list.push_back("botappearance"); - subcommand_list.push_back("botcamp"); - subcommand_list.push_back("botclone"); - subcommand_list.push_back("botcreate"); - subcommand_list.push_back("botdelete"); - subcommand_list.push_back("botfollowdistance"); - subcommand_list.push_back("botinspectmessage"); - subcommand_list.push_back("botlist"); - subcommand_list.push_back("botoutofcombat"); - subcommand_list.push_back("botreport"); - subcommand_list.push_back("botspawn"); - subcommand_list.push_back("botstance"); - subcommand_list.push_back("botstopmeleelevel"); - subcommand_list.push_back("botsummon"); - subcommand_list.push_back("bottoggleranged"); - subcommand_list.push_back("bottogglehelm"); - subcommand_list.push_back("botupdate"); + std::vector subcommand_list = { + "botappearance", + "botcamp", + "botclone", + "botcreate", + "botdelete", + "botfollowdistance", + "botinspectmessage", + "botlist", + "botoutofcombat", + "botreport", + "botspawn", + "botstance", + "botstopmeleelevel", + "botsummon", + "bottoggleranged", + "bottogglehelm", + "botupdate" + }; if (helper_command_alias_fail(c, "bot_command_bot", sep->arg[0], "bot")) return; diff --git a/zone/bot_commands/default_settings.cpp b/zone/bot_commands/default_settings.cpp index 9ac4c9417..e5cd77b00 100644 --- a/zone/bot_commands/default_settings.cpp +++ b/zone/bot_commands/default_settings.cpp @@ -374,7 +374,7 @@ void bot_command_default_settings(Client* c, const Seperator* sep) } else if (!strcasecmp(sep->arg[1], "spelltypesettings")) { if (spell_type != UINT16_MAX) { - my_bot->SetSpellHold(spell_type, my_bot->GetDefaultSpellHold(SpellType, bot_stance)); + my_bot->SetSpellHold(spell_type, my_bot->GetDefaultSpellHold(spell_type, bot_stance)); my_bot->SetSpellDelay(spell_type, my_bot->GetDefaultSpellDelay(spell_type, bot_stance)); my_bot->SetSpellMinThreshold(spell_type, my_bot->GetDefaultSpellMinThreshold(spell_type, bot_stance)); my_bot->SetSpellMaxThreshold(spell_type, my_bot->GetDefaultSpellMaxThreshold(spell_type, bot_stance)); diff --git a/zone/bot_commands/heal_rotation.cpp b/zone/bot_commands/heal_rotation.cpp index 0dd57eb37..2ffd6df23 100644 --- a/zone/bot_commands/heal_rotation.cpp +++ b/zone/bot_commands/heal_rotation.cpp @@ -2,28 +2,28 @@ void bot_command_heal_rotation(Client *c, const Seperator *sep) { - - std::list subcommand_list; - subcommand_list.push_back("healrotationadaptivetargeting"); - subcommand_list.push_back("healrotationaddmember"); - subcommand_list.push_back("healrotationaddtarget"); - subcommand_list.push_back("healrotationadjustcritical"); - subcommand_list.push_back("healrotationadjustsafe"); - subcommand_list.push_back("healrotationcastoverride"); - subcommand_list.push_back("healrotationchangeinterval"); - subcommand_list.push_back("healrotationclearhot"); - subcommand_list.push_back("healrotationcleartargets"); - subcommand_list.push_back("healrotationcreate"); - subcommand_list.push_back("healrotationdelete"); - subcommand_list.push_back("healrotationfastheals"); - subcommand_list.push_back("healrotationlist"); - subcommand_list.push_back("healrotationremovemember"); - subcommand_list.push_back("healrotationremovetarget"); - subcommand_list.push_back("healrotationresetlimits"); - subcommand_list.push_back("healrotationsave"); - subcommand_list.push_back("healrotationsethot"); - subcommand_list.push_back("healrotationstart"); - subcommand_list.push_back("healrotationstop"); + std::vector subcommand_list = { + "healrotationadaptivetargeting", + "healrotationaddmember", + "healrotationaddtarget", + "healrotationadjustcritical", + "healrotationadjustsafe", + "healrotationcastoverride", + "healrotationchangeinterval", + "healrotationclearhot", + "healrotationcleartargets", + "healrotationcreate", + "healrotationdelete", + "healrotationfastheals", + "healrotationlist", + "healrotationremovemember", + "healrotationremovetarget", + "healrotationresetlimits", + "healrotationsave", + "healrotationsethot", + "healrotationstart", + "healrotationstop" + }; if (helper_command_alias_fail(c, "bot_command_heal_rotation", sep->arg[0], "healrotation")) return; diff --git a/zone/bot_commands/inventory.cpp b/zone/bot_commands/inventory.cpp index b83ce228c..48e5f4879 100644 --- a/zone/bot_commands/inventory.cpp +++ b/zone/bot_commands/inventory.cpp @@ -2,12 +2,12 @@ void bot_command_inventory(Client *c, const Seperator *sep) { - - std::list subcommand_list; - subcommand_list.push_back("inventorygive"); - subcommand_list.push_back("inventorylist"); - subcommand_list.push_back("inventoryremove"); - subcommand_list.push_back("inventorywindow"); + std::vector subcommand_list = { + "inventorygive", + "inventorylist", + "inventoryremove", + "inventorywindow" + }; if (helper_command_alias_fail(c, "bot_command_inventory", sep->arg[0], "inventory")) return; diff --git a/zone/bot_commands/pet.cpp b/zone/bot_commands/pet.cpp index d6ba9a383..5406d7132 100644 --- a/zone/bot_commands/pet.cpp +++ b/zone/bot_commands/pet.cpp @@ -3,11 +3,11 @@ void bot_command_pet(Client *c, const Seperator *sep) { - - std::list subcommand_list; - subcommand_list.push_back("petgetlost"); - subcommand_list.push_back("petremove"); - subcommand_list.push_back("petsettype"); + std::vector subcommand_list = { + "petgetlost", + "petremove", + "petsettype" + }; if (helper_command_alias_fail(c, "bot_command_pet", sep->arg[0], "pet")) return; diff --git a/zone/bot_commands/sit_mana_percent.cpp b/zone/bot_commands/sit_mana_percent.cpp index 9aae5fd9f..14e37fa36 100644 --- a/zone/bot_commands/sit_mana_percent.cpp +++ b/zone/bot_commands/sit_mana_percent.cpp @@ -167,7 +167,7 @@ void bot_command_sit_mana_percent(Client* c, const Seperator* sep) fmt::format( "{} of your bots will now sit in combat whem at or below [{}%%] mana.'", success_count, - TypeValue + type_value ).c_str() ); } diff --git a/zone/bot_database.cpp b/zone/bot_database.cpp index 5573de2b1..760108ad9 100644 --- a/zone/bot_database.cpp +++ b/zone/bot_database.cpp @@ -1161,8 +1161,8 @@ bool BotDatabase::SaveEquipmentColor(const uint32 bot_id, const int16 slot_id, c if (all_flag) { where_clause = fmt::format( "IN ({}, {}, {}, {}, {}, {}, {})", - EQ::invslot::SlotHead, - EQ::invslot::SlotArms, + EQ::invslot::slotHead, + EQ::invslot::slotArms, EQ::invslot::slotWrist1, EQ::invslot::slotHands, EQ::invslot::slotChest,