From f02b6c83f890612d3ddd6a2417e16838213c3446 Mon Sep 17 00:00:00 2001 From: Keleborn <22352763+Celandriel@users.noreply.github.com> Date: Thu, 16 Apr 2026 22:12:28 -0700 Subject: [PATCH] cleanup split --- src/Ai/Base/Actions/DebugAction.cpp | 2 +- src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp | 3 -- src/Ai/World/Rpg/NewRpgInfo.cpp | 31 ++++++-------------- src/Ai/World/Rpg/NewRpgInfo.h | 2 ++ src/Mgr/Travel/TravelNode.h | 1 - 5 files changed, 12 insertions(+), 27 deletions(-) diff --git a/src/Ai/Base/Actions/DebugAction.cpp b/src/Ai/Base/Actions/DebugAction.cpp index b79707077..006bf0b80 100644 --- a/src/Ai/Base/Actions/DebugAction.cpp +++ b/src/Ai/Base/Actions/DebugAction.cpp @@ -76,7 +76,7 @@ bool DebugAction::Execute(Event event) return false; std::vector beginPath, endPath; - TravelNodeRoute route = TravelNodeMap::instance().getRoute(botPos, *points.front(), beginPath, bot); + TravelNodeRoute route = TravelNodeMap::instance().GetNearestNodes(botPos, *points.front(), beginPath, bot); std::ostringstream out; out << "Traveling to " << dest->getTitle() << ": "; diff --git a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp index eb989dd42..5ad288a82 100644 --- a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp +++ b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp @@ -292,7 +292,6 @@ bool NewRpgBaseAction::ForceToWait(uint32 duration, MovementPriority priority) return true; } - bool NewRpgBaseAction::TakeFlight(std::vector const& taxiNodes, Creature* flightMaster) { if (taxiNodes.size() < 2 || !flightMaster || !flightMaster->IsAlive()) @@ -1285,5 +1284,3 @@ bool NewRpgBaseAction::CheckRpgStatusAvailable(NewRpgStatus status) } return false; } - - diff --git a/src/Ai/World/Rpg/NewRpgInfo.cpp b/src/Ai/World/Rpg/NewRpgInfo.cpp index 83c780647..120259673 100644 --- a/src/Ai/World/Rpg/NewRpgInfo.cpp +++ b/src/Ai/World/Rpg/NewRpgInfo.cpp @@ -4,43 +4,33 @@ #include "Timer.h" -void NewRpgInfo::ClearTravel() -{ - travelPlan.Reset(); -} - void NewRpgInfo::ChangeToGoGrind(WorldPosition pos) { - startT = getMSTime(); - ClearTravel(); + Reset(); data = GoGrind{pos}; } void NewRpgInfo::ChangeToGoCamp(WorldPosition pos) { - startT = getMSTime(); - ClearTravel(); + Reset(); data = GoCamp{pos}; } void NewRpgInfo::ChangeToWanderNpc() { - startT = getMSTime(); - ClearTravel(); + Reset(); data = WanderNpc{}; } void NewRpgInfo::ChangeToWanderRandom() { - startT = getMSTime(); - ClearTravel(); + Reset(); data = WanderRandom{}; } void NewRpgInfo::ChangeToDoQuest(uint32 questId, const Quest* quest) { - startT = getMSTime(); - ClearTravel(); + Reset(); DoQuest do_quest; do_quest.questId = questId; do_quest.quest = quest; @@ -49,8 +39,7 @@ void NewRpgInfo::ChangeToDoQuest(uint32 questId, const Quest* quest) void NewRpgInfo::ChangeToTravelFlight(ObjectGuid fromFlightMaster, std::vector path) { - startT = getMSTime(); - ClearTravel(); + Reset(); TravelFlight flight; flight.fromFlightMaster = fromFlightMaster; flight.path = std::move(path); @@ -68,15 +57,13 @@ void NewRpgInfo::ChangeToOutdoorPvp(ObjectGuid::LowType capturePointSpawnId) void NewRpgInfo::ChangeToRest() { - startT = getMSTime(); - ClearTravel(); + Reset(); data = Rest{}; } void NewRpgInfo::ChangeToIdle() { - startT = getMSTime(); - ClearTravel(); + Reset(); data = Idle{}; } @@ -89,7 +76,7 @@ void NewRpgInfo::Reset() { data = Idle{}; startT = getMSTime(); - ClearTravel(); + travelPlan.Reset(); } void NewRpgInfo::SetMoveFarTo(WorldPosition pos) diff --git a/src/Ai/World/Rpg/NewRpgInfo.h b/src/Ai/World/Rpg/NewRpgInfo.h index 4a9188489..1008bab15 100644 --- a/src/Ai/World/Rpg/NewRpgInfo.h +++ b/src/Ai/World/Rpg/NewRpgInfo.h @@ -8,6 +8,7 @@ #include "Strategy.h" #include "Timer.h" #include "TravelMgr.h" +#include "TravelNode.h" using NewRpgStatusTransitionProb = std::vector>; @@ -50,6 +51,7 @@ struct NewRpgInfo struct TravelFlight { ObjectGuid fromFlightMaster{}; + WorldPosition fromPos{}; std::vector path; bool inFlight{false}; }; diff --git a/src/Mgr/Travel/TravelNode.h b/src/Mgr/Travel/TravelNode.h index b6d1d48ed..7f368424a 100644 --- a/src/Mgr/Travel/TravelNode.h +++ b/src/Mgr/Travel/TravelNode.h @@ -653,7 +653,6 @@ public: std::vector& startPath, Player* bot = nullptr); - // Manage/update nodes void manageNodes(Unit* bot, bool mapFull = false);