mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-14 20:28:21 +00:00
updates
This commit is contained in:
parent
84ba38bd1d
commit
56ab6bd4c3
@ -399,6 +399,9 @@ void MovementAIComponent::SetDestination(const NiPoint3& destination) {
|
||||
std::vector<NiPoint3> computedPath;
|
||||
if (dpWorld::Instance().IsLoaded()) {
|
||||
computedPath = dpWorld::Instance().GetNavMesh()->GetPath(m_Parent->GetPosition(), destination, m_Info.wanderSpeed);
|
||||
} else {
|
||||
// If we do not have a navmesh, we do not want an AI to be going towards points that are far below or above the map.
|
||||
//
|
||||
}
|
||||
|
||||
// Somehow failed
|
||||
|
@ -223,8 +223,11 @@ public:
|
||||
*/
|
||||
static float GetBaseSpeed(LOT lot);
|
||||
|
||||
void SetCurrentPathWaypointIndex(uint32_t value) { m_CurrentPathWaypointIndex = value; };
|
||||
void SetNextPathWaypointIndex(uint32_t value) { m_NextPathWaypointIndex = value; };
|
||||
private:
|
||||
|
||||
// TODO: Advance properly
|
||||
void SetCurrentPathWaypointIndex(uint32_t value) { };
|
||||
void SetNextPathWaypointIndex(uint32_t value) { };
|
||||
void HandleWaypointCommandGroupEmote(std::string data);
|
||||
void HandleWaypointCommandSetVariable(std::string data);
|
||||
void HandleWaypointCommandCastSkill(std::string data);
|
||||
@ -238,8 +241,6 @@ public:
|
||||
void HandleWaypointCommandChangeWaypoint(std::string data);
|
||||
void HandleWaypointCommandSpawnObject(std::string data);
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Sets the current position of the entity
|
||||
* @param value the position to set
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
void MovementAIComponent::HandleWaypointArrived() {
|
||||
if (!m_Path) return;
|
||||
if (m_Path->pathWaypoints[m_CurrentPathWaypointIndex].commands.empty()) return;
|
||||
for(auto [command, data] : m_Path->pathWaypoints[m_CurrentPathWaypointIndex].commands){
|
||||
if (m_Path->pathWaypoints.at(m_CurrentPathWaypointIndex).commands.empty()) return;
|
||||
for(auto [command, data] : m_Path->pathWaypoints.at(m_CurrentPathWaypointIndex).commands){
|
||||
switch(command){
|
||||
case eWaypointCommandType::STOP:
|
||||
Stop();
|
||||
@ -102,20 +102,20 @@ void MovementAIComponent::HandleWaypointCommandUnequipInventory(std::string data
|
||||
}
|
||||
void MovementAIComponent::HandleWaypointCommandDelay(std::string data) {
|
||||
Pause();
|
||||
std::remove_if(data.begin(), data.end(), isspace);
|
||||
std::remove_if(data.begin(), data.end(), ::isspace);
|
||||
// delay for time
|
||||
}
|
||||
void MovementAIComponent::HandleWaypointCommandEmote(std::string data) {
|
||||
// pause fore animation time
|
||||
// pause for animation time
|
||||
auto delay = RenderComponent::PlayAnimation(m_Parent, data);
|
||||
}
|
||||
void MovementAIComponent::HandleWaypointCommandTeleport(std::string data) {
|
||||
auto posString = GeneralUtils::SplitString(data, ',');
|
||||
if (posString.size() == 0) return;
|
||||
auto newPos = NiPoint3();
|
||||
if (posString.size() == 1) GeneralUtils::TryParse<float>(posString[0], newPos.x);
|
||||
if (posString.size() == 2) GeneralUtils::TryParse<float>(posString[1], newPos.y);
|
||||
if (posString.size() == 3) GeneralUtils::TryParse<float>(posString[2], newPos.z);
|
||||
if (posString.size() == 1) GeneralUtils::TryParse<float>(posString.at(0), newPos.x);
|
||||
if (posString.size() == 2) GeneralUtils::TryParse<float>(posString.at(1), newPos.y);
|
||||
if (posString.size() == 3) GeneralUtils::TryParse<float>(posString.at(2), newPos.z);
|
||||
GameMessages::SendTeleport(m_Parent->GetObjectID(), newPos, NiQuaternion::IDENTITY, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
}
|
||||
void MovementAIComponent::HandleWaypointCommandPathSpeed(std::string data) {
|
||||
|
Loading…
Reference in New Issue
Block a user