cleanup split

This commit is contained in:
Keleborn 2026-04-16 22:12:28 -07:00
parent 40cd808886
commit f02b6c83f8
5 changed files with 12 additions and 27 deletions

View File

@ -76,7 +76,7 @@ bool DebugAction::Execute(Event event)
return false; return false;
std::vector<WorldPosition> beginPath, endPath; std::vector<WorldPosition> 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; std::ostringstream out;
out << "Traveling to " << dest->getTitle() << ": "; out << "Traveling to " << dest->getTitle() << ": ";

View File

@ -292,7 +292,6 @@ bool NewRpgBaseAction::ForceToWait(uint32 duration, MovementPriority priority)
return true; return true;
} }
bool NewRpgBaseAction::TakeFlight(std::vector<uint32> const& taxiNodes, Creature* flightMaster) bool NewRpgBaseAction::TakeFlight(std::vector<uint32> const& taxiNodes, Creature* flightMaster)
{ {
if (taxiNodes.size() < 2 || !flightMaster || !flightMaster->IsAlive()) if (taxiNodes.size() < 2 || !flightMaster || !flightMaster->IsAlive())
@ -1285,5 +1284,3 @@ bool NewRpgBaseAction::CheckRpgStatusAvailable(NewRpgStatus status)
} }
return false; return false;
} }

View File

@ -4,43 +4,33 @@
#include "Timer.h" #include "Timer.h"
void NewRpgInfo::ClearTravel()
{
travelPlan.Reset();
}
void NewRpgInfo::ChangeToGoGrind(WorldPosition pos) void NewRpgInfo::ChangeToGoGrind(WorldPosition pos)
{ {
startT = getMSTime(); Reset();
ClearTravel();
data = GoGrind{pos}; data = GoGrind{pos};
} }
void NewRpgInfo::ChangeToGoCamp(WorldPosition pos) void NewRpgInfo::ChangeToGoCamp(WorldPosition pos)
{ {
startT = getMSTime(); Reset();
ClearTravel();
data = GoCamp{pos}; data = GoCamp{pos};
} }
void NewRpgInfo::ChangeToWanderNpc() void NewRpgInfo::ChangeToWanderNpc()
{ {
startT = getMSTime(); Reset();
ClearTravel();
data = WanderNpc{}; data = WanderNpc{};
} }
void NewRpgInfo::ChangeToWanderRandom() void NewRpgInfo::ChangeToWanderRandom()
{ {
startT = getMSTime(); Reset();
ClearTravel();
data = WanderRandom{}; data = WanderRandom{};
} }
void NewRpgInfo::ChangeToDoQuest(uint32 questId, const Quest* quest) void NewRpgInfo::ChangeToDoQuest(uint32 questId, const Quest* quest)
{ {
startT = getMSTime(); Reset();
ClearTravel();
DoQuest do_quest; DoQuest do_quest;
do_quest.questId = questId; do_quest.questId = questId;
do_quest.quest = quest; do_quest.quest = quest;
@ -49,8 +39,7 @@ void NewRpgInfo::ChangeToDoQuest(uint32 questId, const Quest* quest)
void NewRpgInfo::ChangeToTravelFlight(ObjectGuid fromFlightMaster, std::vector<uint32> path) void NewRpgInfo::ChangeToTravelFlight(ObjectGuid fromFlightMaster, std::vector<uint32> path)
{ {
startT = getMSTime(); Reset();
ClearTravel();
TravelFlight flight; TravelFlight flight;
flight.fromFlightMaster = fromFlightMaster; flight.fromFlightMaster = fromFlightMaster;
flight.path = std::move(path); flight.path = std::move(path);
@ -68,15 +57,13 @@ void NewRpgInfo::ChangeToOutdoorPvp(ObjectGuid::LowType capturePointSpawnId)
void NewRpgInfo::ChangeToRest() void NewRpgInfo::ChangeToRest()
{ {
startT = getMSTime(); Reset();
ClearTravel();
data = Rest{}; data = Rest{};
} }
void NewRpgInfo::ChangeToIdle() void NewRpgInfo::ChangeToIdle()
{ {
startT = getMSTime(); Reset();
ClearTravel();
data = Idle{}; data = Idle{};
} }
@ -89,7 +76,7 @@ void NewRpgInfo::Reset()
{ {
data = Idle{}; data = Idle{};
startT = getMSTime(); startT = getMSTime();
ClearTravel(); travelPlan.Reset();
} }
void NewRpgInfo::SetMoveFarTo(WorldPosition pos) void NewRpgInfo::SetMoveFarTo(WorldPosition pos)

View File

@ -8,6 +8,7 @@
#include "Strategy.h" #include "Strategy.h"
#include "Timer.h" #include "Timer.h"
#include "TravelMgr.h" #include "TravelMgr.h"
#include "TravelNode.h"
using NewRpgStatusTransitionProb = std::vector<std::vector<int>>; using NewRpgStatusTransitionProb = std::vector<std::vector<int>>;
@ -50,6 +51,7 @@ struct NewRpgInfo
struct TravelFlight struct TravelFlight
{ {
ObjectGuid fromFlightMaster{}; ObjectGuid fromFlightMaster{};
WorldPosition fromPos{};
std::vector<uint32> path; std::vector<uint32> path;
bool inFlight{false}; bool inFlight{false};
}; };

View File

@ -653,7 +653,6 @@ public:
std::vector<WorldPosition>& startPath, std::vector<WorldPosition>& startPath,
Player* bot = nullptr); Player* bot = nullptr);
// Manage/update nodes // Manage/update nodes
void manageNodes(Unit* bot, bool mapFull = false); void manageNodes(Unit* bot, bool mapFull = false);