Change GetRaidByBotName to GetRaidByBot

This commit is contained in:
nytmyr
2024-12-20 09:40:01 -06:00
parent 322f8c5ffd
commit d64af967ea
+9 -9
View File
@@ -2056,7 +2056,7 @@ void Bot::AI_Process()
return; return;
} }
auto raid = entity_list.GetRaidByBotName(GetName()); auto raid = entity_list.GetRaidByBot(this);
uint32 r_group = RAID_GROUPLESS; uint32 r_group = RAID_GROUPLESS;
if (raid) { if (raid) {
@@ -2503,7 +2503,7 @@ bool Bot::TryAutoDefend(Client* bot_owner, float leash_distance) {
bool assisteeFound = false; bool assisteeFound = false;
if (IsRaidGrouped()) { if (IsRaidGrouped()) {
Raid* r = entity_list.GetRaidByBotName(GetName()); Raid* r = entity_list.GetRaidByBot(this);
if (r) { if (r) {
for (const auto& m : r->members) { for (const auto& m : r->members) {
if ( if (
@@ -3553,7 +3553,7 @@ bool Bot::Spawn(Client* botCharacterOwner) {
ChangeBotRangedWeapons(true); ChangeBotRangedWeapons(true);
} }
if (auto raid = entity_list.GetRaidByBotName(GetName())) { if (auto raid = entity_list.GetRaidByBot(this)) {
// Safety Check to confirm we have a valid raid // Safety Check to confirm we have a valid raid
auto owner = GetBotOwner(); auto owner = GetBotOwner();
if (owner && !raid->IsRaidMember(owner->GetCleanName())) { if (owner && !raid->IsRaidMember(owner->GetCleanName())) {
@@ -3564,7 +3564,7 @@ bool Bot::Spawn(Client* botCharacterOwner) {
raid->VerifyRaid(); raid->VerifyRaid();
} }
} }
else if (auto group = entity_list.GetGroupByMobName(GetName())) { else if (auto group = entity_list.GetGroupByMob(this)) {
// Safety Check to confirm we have a valid group // Safety Check to confirm we have a valid group
auto owner = GetBotOwner(); auto owner = GetBotOwner();
if (owner && !group->IsGroupMember(owner->GetCleanName())) { if (owner && !group->IsGroupMember(owner->GetCleanName())) {
@@ -6047,7 +6047,7 @@ bool Bot::DoFinishedSpellSingleTarget(uint16 spell_id, Mob* spellTarget, EQ::spe
bool Bot::DoFinishedSpellGroupTarget(uint16 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool& stopLogic) { bool Bot::DoFinishedSpellGroupTarget(uint16 spell_id, Mob* spellTarget, EQ::spells::CastingSlot slot, bool& stopLogic) {
bool isMainGroupMGB = false; bool isMainGroupMGB = false;
Raid* raid = entity_list.GetRaidByBotName(GetName()); Raid* raid = entity_list.GetRaidByBot(this);
if (isMainGroupMGB && (GetClass() != Class::Bard)) { if (isMainGroupMGB && (GetClass() != Class::Bard)) {
BotGroupSay( BotGroupSay(
@@ -6783,7 +6783,7 @@ void Bot::Camp(bool save_to_database) {
} }
void Bot::Zone() { void Bot::Zone() {
if (auto raid = entity_list.GetRaidByBotName(GetName())) { if (auto raid = entity_list.GetRaidByBot(this)) {
raid->MemberZoned(CastToClient()); raid->MemberZoned(CastToClient());
} }
else if (HasGroup()) { else if (HasGroup()) {
@@ -7027,7 +7027,7 @@ void Bot::ProcessBotGroupDisband(Client* c, const std::string& botName) {
// Processes a raid disband request from a Client for a Bot. // Processes a raid disband request from a Client for a Bot.
void Bot::RemoveBotFromRaid(Bot* bot) { void Bot::RemoveBotFromRaid(Bot* bot) {
Raid* bot_raid = entity_list.GetRaidByBotName(bot->GetName()); Raid* bot_raid = entity_list.GetRaidByBot(bot);
if (bot_raid) { if (bot_raid) {
uint32 gid = bot_raid->GetGroup(bot->GetName()); uint32 gid = bot_raid->GetGroup(bot->GetName());
bot_raid->SendRaidGroupRemove(bot->GetName(), gid); bot_raid->SendRaidGroupRemove(bot->GetName(), gid);
@@ -7048,7 +7048,7 @@ void Bot::ProcessClientZoneChange(Client* botOwner) {
Bot* tempBot = *itr; Bot* tempBot = *itr;
if (tempBot) { if (tempBot) {
Raid* raid = entity_list.GetRaidByBotName(tempBot->GetName()); Raid* raid = entity_list.GetRaidByBot(tempBot);
if (raid) { if (raid) {
tempBot->Zone(); tempBot->Zone();
} }
@@ -7781,7 +7781,7 @@ void Bot::BotGroupSay(Mob* speaker, const char* msg, ...) {
va_end(ap); va_end(ap);
if (speaker->IsRaidGrouped()) { if (speaker->IsRaidGrouped()) {
Raid* r = entity_list.GetRaidByBotName(speaker->GetName()); Raid* r = entity_list.GetRaidByBot(speaker->CastToBot());
if (r) { if (r) {
for (const auto& m : r->members) { for (const auto& m : r->members) {
if (m.member && !m.is_bot) { if (m.member && !m.is_bot) {