Improper singletons migration to clean Meyer's singletons (cherry-pick) (#2082)

# Pull Request

- Applies the clean and corrected singletons, Meyer pattern. (cherry
picked from @SmashingQuasar )

Testing by just playing the game in various ways. Been tested by myself
@Celandriel and @SmashingQuasar
---

## Complexity & Impact

- Does this change add new decision branches?
    - [x] No
    - [ ] Yes (**explain below**)

- Does this change increase per-bot or per-tick processing?
    - [x] No
    - [ ] Yes (**describe and justify impact**)

- Could this logic scale poorly under load?
    - [x] No
    - [ ] Yes (**explain why**)

---

## Defaults & Configuration

- Does this change modify default bot behavior?
    - [x] No
    - [ ] Yes (**explain why**)

---

## AI Assistance

- Was AI assistance (e.g. ChatGPT or similar tools) used while working
on this change?
    - [x] No
    - [ ] Yes (**explain below**)
---

## Final Checklist

- [x] Stability is not compromised
- [x] Performance impact is understood, tested, and acceptable
- [x] Added logic complexity is justified and explained
- [x] Documentation updated if needed

---

## Notes for Reviewers

Anything that significantly improves realism at the cost of stability or
performance should be carefully discussed
before merging.

---------

Co-authored-by: Nicolas Lebacq <nicolas.cordier@outlook.com>
Co-authored-by: Keleborn <22352763+Celandriel@users.noreply.github.com>
This commit is contained in:
bashermens
2026-01-30 21:49:37 +01:00
committed by GitHub
parent a92886032c
commit 13fff46fa0
233 changed files with 2460 additions and 2354 deletions

View File

@@ -15,4 +15,4 @@ public:
// virtual void InitMultipliers(std::vector<Multiplier*> &multipliers) override;
};
#endif
#endif

View File

@@ -6810,7 +6810,7 @@ bool IccLichKingShadowTrapAction::Execute(Event event)
Difficulty diff = bot->GetRaidDifficulty();
if (sPlayerbotAIConfig->EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
if (sPlayerbotAIConfig.EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
{
//-------CHEAT-------
if (!bot->HasAura(SPELL_EXPERIENCED))
@@ -7006,7 +7006,7 @@ bool IccLichKingWinterAction::Execute(Event event)
Difficulty diff = bot->GetRaidDifficulty();
if (sPlayerbotAIConfig->EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
if (sPlayerbotAIConfig.EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
{
//------CHEAT-------
if (!bot->HasAura(SPELL_EXPERIENCED))
@@ -7792,7 +7792,7 @@ bool IccLichKingAddsAction::Execute(Event event)
Difficulty diff = bot->GetRaidDifficulty();
if (sPlayerbotAIConfig->EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
if (sPlayerbotAIConfig.EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
{
//------CHEAT-------
if (!bot->HasAura(SPELL_EXPERIENCED))
@@ -9192,7 +9192,7 @@ void IccLichKingAddsAction::HandleValkyrAssignment(const std::vector<Unit*>& gra
bot->SetFacingToObject(myValkyr);
Difficulty diff = bot->GetRaidDifficulty();
if (sPlayerbotAIConfig->EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
if (sPlayerbotAIConfig.EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
{
//---------CHEAT---------
if (!myValkyr->HasAura(SPELL_HAMMER_OF_JUSTICE))

View File

@@ -3,4 +3,4 @@
#include "../../../../src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h"
#endif
#endif

View File

@@ -287,7 +287,7 @@ bool IccPutricideGrowingOozePuddleTrigger::IsActive()
Difficulty diff = bot->GetRaidDifficulty();
if (sPlayerbotAIConfig->EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
if (sPlayerbotAIConfig.EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
{
//-------CHEAT-------
if (!bot->HasAura(SPELL_EXPERIENCED))
@@ -834,7 +834,7 @@ bool IccSindragosaGroupPositionTrigger::IsActive()
Difficulty diff = bot->GetRaidDifficulty();
if (sPlayerbotAIConfig->EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
if (sPlayerbotAIConfig.EnableICCBuffs && diff && (diff == RAID_DIFFICULTY_10MAN_HEROIC || diff == RAID_DIFFICULTY_25MAN_HEROIC))
{
//-------CHEAT-------
if (!bot->HasAura(SPELL_EXPERIENCED))

View File

@@ -617,7 +617,7 @@ bool NetherspiteBlockRedBeamAction::Execute(Event event)
if (!wasBlocking)
{
std::map<std::string, std::string> placeholders{{"%player", bot->GetName()}};
std::string text = sPlayerbotTextMgr->GetBotTextOrDefault(
std::string text = PlayerbotTextMgr::instance().GetBotTextOrDefault(
"netherspite_beam_blocking_red", "%player is moving to block the red beam!", placeholders);
bot->Yell(text, LANG_UNIVERSAL);
}
@@ -700,7 +700,7 @@ bool NetherspiteBlockBlueBeamAction::Execute(Event event)
if (wasBlocking && !isBlockingNow)
{
std::map<std::string, std::string> placeholders{{"%player", bot->GetName()}};
std::string text = sPlayerbotTextMgr->GetBotTextOrDefault(
std::string text = PlayerbotTextMgr::instance().GetBotTextOrDefault(
"netherspite_beam_leaving_blue", "%player is leaving the blue beam--next blocker up!", placeholders);
bot->Yell(text, LANG_UNIVERSAL);
_wasBlockingBlueBeam[botGuid] = false;
@@ -711,7 +711,7 @@ bool NetherspiteBlockBlueBeamAction::Execute(Event event)
if (!wasBlocking)
{
std::map<std::string, std::string> placeholders{{"%player", bot->GetName()}};
std::string text = sPlayerbotTextMgr->GetBotTextOrDefault(
std::string text = PlayerbotTextMgr::instance().GetBotTextOrDefault(
"netherspite_beam_blocking_blue", "%player is moving to block the blue beam!", placeholders);
bot->Yell(text, LANG_UNIVERSAL);
}
@@ -793,7 +793,7 @@ bool NetherspiteBlockGreenBeamAction::Execute(Event event)
if (wasBlocking && !isBlockingNow)
{
std::map<std::string, std::string> placeholders{{"%player", bot->GetName()}};
std::string text = sPlayerbotTextMgr->GetBotTextOrDefault(
std::string text = PlayerbotTextMgr::instance().GetBotTextOrDefault(
"netherspite_beam_leaving_green", "%player is leaving the green beam--next blocker up!", placeholders);
bot->Yell(text, LANG_UNIVERSAL);
_wasBlockingGreenBeam[botGuid] = false;
@@ -804,7 +804,7 @@ bool NetherspiteBlockGreenBeamAction::Execute(Event event)
if (!wasBlocking)
{
std::map<std::string, std::string> placeholders{{"%player", bot->GetName()}};
std::string text = sPlayerbotTextMgr->GetBotTextOrDefault(
std::string text = PlayerbotTextMgr::instance().GetBotTextOrDefault(
"netherspite_beam_blocking_green", "%player is moving to block the green beam!", placeholders);
bot->Yell(text, LANG_UNIVERSAL);
}

View File

@@ -260,4 +260,4 @@ private:
PlayerbotAI* botAI) { return new NightbaneNeedToManageTimersAndTrackersTrigger(botAI); }
};
#endif
#endif

View File

@@ -243,4 +243,4 @@ bool ExitTwilightPortalAction::Execute(Event event)
bot->GetSession()->HandleGameObjectUseOpcode(data1);
return true;
}
}

View File

@@ -2964,7 +2964,7 @@ bool YoggSaronMoveToEnterPortalAction::Execute(Event event)
{
return MoveNear(bot->GetMapId(), assignedPortalPosition.GetPositionX(),
assignedPortalPosition.GetPositionY(),
assignedPortalPosition.GetPositionZ(), sPlayerbotAIConfig->contactDistance,
assignedPortalPosition.GetPositionZ(), sPlayerbotAIConfig.contactDistance,
MovementPriority::MOVEMENT_FORCED);
}
}

View File

@@ -25,4 +25,4 @@ float FlameLeviathanMultiplier::GetValue(Action* action)
// if (dynamic_cast<FleeAction*>(action))
// return 0.0f;
return 1.0f;
}
}

View File

@@ -14,4 +14,4 @@ public:
virtual float GetValue(Action* action);
};
#endif
#endif

View File

@@ -15,4 +15,4 @@ public:
virtual void InitMultipliers(std::vector<Multiplier*>& multipliers) override;
};
#endif
#endif

View File

@@ -1621,7 +1621,7 @@ bool VezaxCheatTrigger::IsActive()
return false;
}
return AI_VALUE2(uint8, "mana", "self target") < sPlayerbotAIConfig->lowMana;
return AI_VALUE2(uint8, "mana", "self target") < sPlayerbotAIConfig.lowMana;
}
bool VezaxShadowCrashTrigger::IsActive()