mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-03 10:53:48 +00:00
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:
@@ -48,7 +48,7 @@ class LowHealthTrigger : public HealthInRangeTrigger
|
||||
{
|
||||
public:
|
||||
LowHealthTrigger(PlayerbotAI* botAI, std::string const name = "low health",
|
||||
float value = sPlayerbotAIConfig->lowHealth, float minValue = 0)
|
||||
float value = sPlayerbotAIConfig.lowHealth, float minValue = 0)
|
||||
: HealthInRangeTrigger(botAI, name, value, minValue)
|
||||
{
|
||||
}
|
||||
@@ -60,7 +60,7 @@ class CriticalHealthTrigger : public LowHealthTrigger
|
||||
{
|
||||
public:
|
||||
CriticalHealthTrigger(PlayerbotAI* botAI)
|
||||
: LowHealthTrigger(botAI, "critical health", sPlayerbotAIConfig->criticalHealth, 0)
|
||||
: LowHealthTrigger(botAI, "critical health", sPlayerbotAIConfig.criticalHealth, 0)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -69,7 +69,7 @@ class MediumHealthTrigger : public LowHealthTrigger
|
||||
{
|
||||
public:
|
||||
MediumHealthTrigger(PlayerbotAI* botAI)
|
||||
: LowHealthTrigger(botAI, "medium health", sPlayerbotAIConfig->mediumHealth, 0)
|
||||
: LowHealthTrigger(botAI, "medium health", sPlayerbotAIConfig.mediumHealth, 0)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -78,8 +78,8 @@ class AlmostFullHealthTrigger : public LowHealthTrigger
|
||||
{
|
||||
public:
|
||||
AlmostFullHealthTrigger(PlayerbotAI* botAI)
|
||||
: LowHealthTrigger(botAI, "almost full health", sPlayerbotAIConfig->almostFullHealth,
|
||||
sPlayerbotAIConfig->mediumHealth)
|
||||
: LowHealthTrigger(botAI, "almost full health", sPlayerbotAIConfig.almostFullHealth,
|
||||
sPlayerbotAIConfig.mediumHealth)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -88,7 +88,7 @@ class PartyMemberLowHealthTrigger : public HealthInRangeTrigger
|
||||
{
|
||||
public:
|
||||
PartyMemberLowHealthTrigger(PlayerbotAI* botAI, std::string const name = "party member low health",
|
||||
float value = sPlayerbotAIConfig->lowHealth,
|
||||
float value = sPlayerbotAIConfig.lowHealth,
|
||||
float minValue = 0)
|
||||
: HealthInRangeTrigger(botAI, name, value, minValue)
|
||||
{
|
||||
@@ -101,7 +101,7 @@ class PartyMemberCriticalHealthTrigger : public PartyMemberLowHealthTrigger
|
||||
{
|
||||
public:
|
||||
PartyMemberCriticalHealthTrigger(PlayerbotAI* botAI)
|
||||
: PartyMemberLowHealthTrigger(botAI, "party member critical health", sPlayerbotAIConfig->criticalHealth, 0)
|
||||
: PartyMemberLowHealthTrigger(botAI, "party member critical health", sPlayerbotAIConfig.criticalHealth, 0)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -110,7 +110,7 @@ class PartyMemberMediumHealthTrigger : public PartyMemberLowHealthTrigger
|
||||
{
|
||||
public:
|
||||
PartyMemberMediumHealthTrigger(PlayerbotAI* botAI)
|
||||
: PartyMemberLowHealthTrigger(botAI, "party member medium health", sPlayerbotAIConfig->mediumHealth,
|
||||
: PartyMemberLowHealthTrigger(botAI, "party member medium health", sPlayerbotAIConfig.mediumHealth,
|
||||
0)
|
||||
{
|
||||
}
|
||||
@@ -120,7 +120,7 @@ class PartyMemberAlmostFullHealthTrigger : public PartyMemberLowHealthTrigger
|
||||
{
|
||||
public:
|
||||
PartyMemberAlmostFullHealthTrigger(PlayerbotAI* botAI)
|
||||
: PartyMemberLowHealthTrigger(botAI, "party member almost full health", sPlayerbotAIConfig->almostFullHealth,
|
||||
: PartyMemberLowHealthTrigger(botAI, "party member almost full health", sPlayerbotAIConfig.almostFullHealth,
|
||||
0)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user