mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
fix(Core/Paladin): Remove duplicate trigger registrations (#2301)
<!--
Thank you for contributing to mod-playerbots, please make sure that
you...
1. Submit your PR to the test-staging branch, not master.
2. Read the guidelines below before submitting.
3. Don't delete parts of this template.
DESIGN PHILOSOPHY: We prioritize STABILITY, PERFORMANCE, AND
PREDICTABILITY over behavioral realism.
Every action and decision executes PER BOT AND PER TRIGGER. Small
increases in logic complexity scale
poorly across thousands of bots and negatively affect all. We prioritize
a stable system over a smarter
one. Bots don't need to behave perfectly; believable behavior is the
goal, not human simulation.
Default behavior must be cheap in processing; expensive behavior must be
opt-in.
Before submitting, make sure your changes aligns with these principles.
-->
## Pull Request Description
<!-- Describe what this change does and why it is needed -->
The "lay on hands", "lay on hands on party", "blessing of protection on
party", and "divine plea" triggers were registered twice with
conflicting priorities, causing double-firing. Removes the old block
while preserving the new "hand of freedom on party" trigger.
@kadeshar Can you confirm this matches your intent?
## Feature Evaluation
<!--
If your PR is very minimal (comment typo, wrong ID reference, etc), and
it is very obvious it will not have
any impact on performance, you may skip these question. If necessary, a
maintainer may ask you for them later.
-->
<!-- Please answer the following: -->
- Describe the **minimum logic** required to achieve the intended
behavior.
- Describe the **processing cost** when this logic executes across many
bots.
## How to Test the Changes
<!--
- Step-by-step instructions to test the change.
- Any required setup (e.g. multiple players, number of bots, specific
configuration).
- Expected behavior and how to verify it.
-->
## Impact Assessment
<!-- As a generic test, before and after measure of pmon (playerbot pmon
tick) can help you here. -->
- Does this change increase per-bot/per-tick processing or risk scaling
poorly with thousands of bots?
- - [X] No, not at all
- - [ ] Minimal impact (**explain below**)
- - [ ] Moderate impact (**explain below**)
- Does this change modify default bot behavior?
- - [X] No
- - [ ] Yes (**explain why**)
- Does this change add new decision branches or increase maintenance
complexity?
- - [X] No
- - [ ] Yes (**explain below**)
## Messages to Translate
<!--
Bot messages have to be translatable, but you don't need to do the
translations here. You only need to make sure
the message is in a translatable format, and list in the table the
message_key and the default English message.
Search for GetBotTextOrDefault in the codebase for examples.
-->
- Does this change add bot messages to translate?
- - [X] No
- - [ ] Yes (**list messages in the table**)
| Message key | Default message |
| --------------- | ------------------ |
| | |
| | |
## AI Assistance
<!--
AI assistance is allowed, but all submitted code must be fully
understood, reviewed, and owned by the contributor.
We expect contributors to be honest about what they do and do not
understand.
-->
- Was AI assistance used while working on this change?
- - [ ] No
- - [X] Yes (**explain below**)
<!--
If yes, please specify:
- Purpose of usage (e.g. brainstorming, refactoring, documentation, code
generation).
- Which parts of the change were influenced or generated, and whether it
was thoroughly reviewed.
-->
Claude spotted the error on review and ran ahead with a fix, but I
confirmed that it is infact duplicate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
## 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 (Conf comments, WiKi commands).
## Notes for Reviewers
<!-- Anything else that's helpful to review or test your pull request.
-->
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
03db0c34b2
commit
5e2f2823ec
@ -31,19 +31,8 @@ void GenericPaladinStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
|||||||
triggers.push_back(new TriggerNode("protect party member",
|
triggers.push_back(new TriggerNode("protect party member",
|
||||||
{ NextAction("blessing of protection on party", ACTION_EMERGENCY + 3) }));
|
{ NextAction("blessing of protection on party", ACTION_EMERGENCY + 3) }));
|
||||||
triggers.push_back(new TriggerNode("high mana", { NextAction("divine plea", ACTION_HIGH) }));
|
triggers.push_back(new TriggerNode("high mana", { NextAction("divine plea", ACTION_HIGH) }));
|
||||||
triggers.push_back(new TriggerNode(
|
triggers.push_back(new TriggerNode("hand of freedom on party",
|
||||||
"critical health", { NextAction("lay on hands", ACTION_EMERGENCY) }));
|
|
||||||
triggers.push_back(
|
|
||||||
new TriggerNode("party member critical health",
|
|
||||||
{ NextAction("lay on hands on party", ACTION_EMERGENCY + 1) }));
|
|
||||||
triggers.push_back(new TriggerNode(
|
|
||||||
"protect party member",
|
|
||||||
{ NextAction("blessing of protection on party", ACTION_EMERGENCY + 2) }));
|
|
||||||
triggers.push_back(new TriggerNode(
|
|
||||||
"hand of freedom on party",
|
|
||||||
{ NextAction("hand of freedom on party", ACTION_HIGH + 4) }));
|
{ NextAction("hand of freedom on party", ACTION_HIGH + 4) }));
|
||||||
triggers.push_back(
|
|
||||||
new TriggerNode("high mana", { NextAction("divine plea", ACTION_HIGH) }));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaladinCureStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
void PaladinCureStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user