From a2db0e3ad1214a08bc1a5cbdedcb31bbd5cb117b Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Wed, 24 Jul 2024 23:43:16 +0800 Subject: [PATCH] [Initialization] Remove duplicate mount init --- conf/playerbots.conf.dist | 2 +- src/PlayerbotFactory.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index e7826de0..e14601e9 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -1289,7 +1289,7 @@ AiPlayerbot.RandomBotGuildCount = 20 AiPlayerbot.DeleteRandomBotGuilds = 0 # Chance bot chooses RPG (Teleport to random camp for their level) instead of grinding -AiPlayerbot.RandomBotRpgChance = 0.20 #unused now +AiPlayerbot.RandomBotRpgChance = 0.20 # Set randombots movement speed to walking anywhere AiPlayerbot.RandombotsWalkingRPG = 0 diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 8ddf2086..21409f18 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -2620,6 +2620,16 @@ void PlayerbotFactory::InitMounts() for (uint32 type = 0; type < 4; type++) { + bool hasMount = false; + for (uint32 &spell : mounts[bot->getRace()][type]) { + if (bot->HasSpell(spell)) { + hasMount = true; + break; + } + } + if (hasMount) + continue; + if (bot->GetLevel() < secondmount && type == 1) continue;