mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
cleanup split
This commit is contained in:
parent
40cd808886
commit
f02b6c83f8
@ -76,7 +76,7 @@ bool DebugAction::Execute(Event event)
|
||||
return false;
|
||||
|
||||
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;
|
||||
out << "Traveling to " << dest->getTitle() << ": ";
|
||||
|
||||
@ -292,7 +292,6 @@ bool NewRpgBaseAction::ForceToWait(uint32 duration, MovementPriority priority)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool NewRpgBaseAction::TakeFlight(std::vector<uint32> const& taxiNodes, Creature* flightMaster)
|
||||
{
|
||||
if (taxiNodes.size() < 2 || !flightMaster || !flightMaster->IsAlive())
|
||||
@ -1285,5 +1284,3 @@ bool NewRpgBaseAction::CheckRpgStatusAvailable(NewRpgStatus status)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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<uint32> 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)
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "Strategy.h"
|
||||
#include "Timer.h"
|
||||
#include "TravelMgr.h"
|
||||
#include "TravelNode.h"
|
||||
|
||||
using NewRpgStatusTransitionProb = std::vector<std::vector<int>>;
|
||||
|
||||
@ -50,6 +51,7 @@ struct NewRpgInfo
|
||||
struct TravelFlight
|
||||
{
|
||||
ObjectGuid fromFlightMaster{};
|
||||
WorldPosition fromPos{};
|
||||
std::vector<uint32> path;
|
||||
bool inFlight{false};
|
||||
};
|
||||
|
||||
@ -653,7 +653,6 @@ public:
|
||||
std::vector<WorldPosition>& startPath,
|
||||
Player* bot = nullptr);
|
||||
|
||||
|
||||
// Manage/update nodes
|
||||
void manageNodes(Unit* bot, bool mapFull = false);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user