mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-03-16 22:05:09 +00:00
Warnings PR 1: Event warnings and headers (#2106)
# Pull Request
This is the first in a series of PRs intended to eliminate warnings in
the module. The design intent is to eliminate the calling event when not
needed in the body of the function. Based off of SmashingQuasars work.
---
## How to Test the Changes
- Step-by-step instructions to test the change
- Any required setup (e.g. multiple players, bots, specific
configuration)
- Expected behavior and how to verify it
## 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**)
If this introduces more advanced or AI-heavy logic:
- [ ] Lightweight mode remains the default
- [ ] More complex behavior is optional and thereby configurable
---
## 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: bashermens <31279994+hermensbas@users.noreply.github.com>
This commit is contained in:
@@ -99,7 +99,7 @@ Event RpgSubAction::ActionEvent(Event event) { return event; }
|
||||
|
||||
bool RpgStayAction::isUseful() { return rpg->InRange() && !botAI->HasRealPlayerMaster(); }
|
||||
|
||||
bool RpgStayAction::Execute(Event event)
|
||||
bool RpgStayAction::Execute(Event /*event*/)
|
||||
{
|
||||
bot->PlayerTalkClass->SendCloseGossip();
|
||||
|
||||
@@ -109,7 +109,7 @@ bool RpgStayAction::Execute(Event event)
|
||||
|
||||
bool RpgWorkAction::isUseful() { return rpg->InRange() && !botAI->HasRealPlayerMaster(); }
|
||||
|
||||
bool RpgWorkAction::Execute(Event event)
|
||||
bool RpgWorkAction::Execute(Event /*event*/)
|
||||
{
|
||||
bot->HandleEmoteCommand(EMOTE_STATE_USE_STANDING);
|
||||
rpg->AfterExecute();
|
||||
@@ -118,7 +118,7 @@ bool RpgWorkAction::Execute(Event event)
|
||||
|
||||
bool RpgEmoteAction::isUseful() { return rpg->InRange() && !botAI->HasRealPlayerMaster(); }
|
||||
|
||||
bool RpgEmoteAction::Execute(Event event)
|
||||
bool RpgEmoteAction::Execute(Event /*event*/)
|
||||
{
|
||||
uint32 type = TalkAction::GetRandomEmote(rpg->guidP().GetUnit());
|
||||
|
||||
@@ -133,7 +133,7 @@ bool RpgEmoteAction::Execute(Event event)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RpgCancelAction::Execute(Event event)
|
||||
bool RpgCancelAction::Execute(Event /*event*/)
|
||||
{
|
||||
RESET_AI_VALUE(GuidPosition, "rpg target");
|
||||
rpg->OnExecute("");
|
||||
@@ -142,7 +142,7 @@ bool RpgCancelAction::Execute(Event event)
|
||||
|
||||
bool RpgTaxiAction::isUseful() { return rpg->InRange() && !botAI->HasRealPlayerMaster(); }
|
||||
|
||||
bool RpgTaxiAction::Execute(Event event)
|
||||
bool RpgTaxiAction::Execute(Event /*event*/)
|
||||
{
|
||||
GuidPosition guidP = rpg->guidP();
|
||||
|
||||
@@ -203,7 +203,7 @@ bool RpgTaxiAction::Execute(Event event)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RpgDiscoverAction::Execute(Event event)
|
||||
bool RpgDiscoverAction::Execute(Event /*event*/)
|
||||
{
|
||||
GuidPosition guidP = rpg->guidP();
|
||||
|
||||
@@ -222,7 +222,7 @@ bool RpgDiscoverAction::Execute(Event event)
|
||||
|
||||
std::string const RpgStartQuestAction::ActionName() { return "accept all quests"; }
|
||||
|
||||
Event RpgStartQuestAction::ActionEvent(Event event)
|
||||
Event RpgStartQuestAction::ActionEvent(Event /*event*/)
|
||||
{
|
||||
WorldPacket p(CMSG_QUESTGIVER_ACCEPT_QUEST);
|
||||
p << rpg->guid();
|
||||
@@ -232,7 +232,7 @@ Event RpgStartQuestAction::ActionEvent(Event event)
|
||||
|
||||
std::string const RpgEndQuestAction::ActionName() { return "talk to quest giver"; }
|
||||
|
||||
Event RpgEndQuestAction::ActionEvent(Event event)
|
||||
Event RpgEndQuestAction::ActionEvent(Event /*event*/)
|
||||
{
|
||||
WorldPacket p(CMSG_QUESTGIVER_COMPLETE_QUEST);
|
||||
p << rpg->guid();
|
||||
@@ -242,17 +242,17 @@ Event RpgEndQuestAction::ActionEvent(Event event)
|
||||
|
||||
std::string const RpgBuyAction::ActionName() { return "buy"; }
|
||||
|
||||
Event RpgBuyAction::ActionEvent(Event event) { return Event("rpg action", "vendor"); }
|
||||
Event RpgBuyAction::ActionEvent(Event /*event*/) { return Event("rpg action", "vendor"); }
|
||||
|
||||
std::string const RpgSellAction::ActionName() { return "sell"; }
|
||||
|
||||
Event RpgSellAction::ActionEvent(Event event) { return Event("rpg action", "vendor"); }
|
||||
Event RpgSellAction::ActionEvent(Event /*event*/) { return Event("rpg action", "vendor"); }
|
||||
|
||||
std::string const RpgRepairAction::ActionName() { return "repair"; }
|
||||
|
||||
std::string const RpgTrainAction::ActionName() { return "trainer"; }
|
||||
|
||||
bool RpgHealAction::Execute(Event event)
|
||||
bool RpgHealAction::Execute(Event /*event*/)
|
||||
{
|
||||
bool retVal = false;
|
||||
|
||||
@@ -287,21 +287,21 @@ std::string const RpgBuyPetitionAction::ActionName() { return "buy petition"; }
|
||||
|
||||
std::string const RpgUseAction::ActionName() { return "use"; }
|
||||
|
||||
Event RpgUseAction::ActionEvent(Event event)
|
||||
Event RpgUseAction::ActionEvent(Event /*event*/)
|
||||
{
|
||||
return Event("rpg action", chat->FormatWorldobject(rpg->guidP().GetWorldObject()));
|
||||
}
|
||||
|
||||
std::string const RpgSpellAction::ActionName() { return "cast random spell"; }
|
||||
|
||||
Event RpgSpellAction::ActionEvent(Event event)
|
||||
Event RpgSpellAction::ActionEvent(Event /*event*/)
|
||||
{
|
||||
return Event("rpg action", chat->FormatWorldobject(rpg->guidP().GetWorldObject()));
|
||||
}
|
||||
|
||||
std::string const RpgCraftAction::ActionName() { return "craft random item"; }
|
||||
|
||||
Event RpgCraftAction::ActionEvent(Event event)
|
||||
Event RpgCraftAction::ActionEvent(Event /*event*/)
|
||||
{
|
||||
return Event("rpg action", chat->FormatWorldobject(rpg->guidP().GetWorldObject()));
|
||||
}
|
||||
@@ -341,7 +341,7 @@ std::vector<Item*> RpgTradeUsefulAction::CanGiveItems(GuidPosition guidPosition)
|
||||
return giveItems;
|
||||
}
|
||||
|
||||
bool RpgTradeUsefulAction::Execute(Event event)
|
||||
bool RpgTradeUsefulAction::Execute(Event /*event*/)
|
||||
{
|
||||
GuidPosition guidP = AI_VALUE(GuidPosition, "rpg target");
|
||||
|
||||
@@ -416,7 +416,7 @@ bool RpgDuelAction::isUseful()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RpgDuelAction::Execute(Event event)
|
||||
bool RpgDuelAction::Execute(Event /*event*/)
|
||||
{
|
||||
GuidPosition guidP = AI_VALUE(GuidPosition, "rpg target");
|
||||
|
||||
@@ -434,7 +434,7 @@ bool RpgMountAnimAction::isUseful()
|
||||
return AI_VALUE2(bool, "mounted", "self target") && !AI_VALUE2(bool, "moving", "self target");
|
||||
}
|
||||
|
||||
bool RpgMountAnimAction::Execute(Event event)
|
||||
bool RpgMountAnimAction::Execute(Event /*event*/)
|
||||
{
|
||||
WorldPacket p;
|
||||
bot->GetSession()->HandleMountSpecialAnimOpcode(p);
|
||||
|
||||
Reference in New Issue
Block a user