mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-15 04:38:21 +00:00
Add file for u aronwk
This commit is contained in:
parent
d372278b25
commit
ed0c979544
@ -54,6 +54,21 @@ MovementAIComponent::MovementAIComponent(Entity* parent, MovementAIInfo info) :
|
||||
m_NextPathWaypointIndex = 0;
|
||||
}
|
||||
|
||||
void MovementAIComponent::SetupPath(const std::string& pathname) {
|
||||
std::string path = pathname;
|
||||
if (path.empty()) path = m_Parent->GetVarAsString(u"attached_path");
|
||||
if (path.empty()) {
|
||||
Game::logger->Log("MovementAIComponent", "No path to load for %i:%llu", m_Parent->GetLOT(), m_Parent->GetObjectID());
|
||||
return;
|
||||
}
|
||||
const Path* pathData = Game::zoneManager->GetZone()->GetPath(path);
|
||||
if (pathData) {
|
||||
Game::logger->Log("MovementAIComponent", "found path %s", path.c_str());
|
||||
} else {
|
||||
Game::logger->Log("MovementAIComponent", "No path found for %i:%llu", m_Parent->GetLOT(), m_Parent->GetObjectID());
|
||||
}
|
||||
}
|
||||
|
||||
void MovementAIComponent::Update(const float deltaTime) {
|
||||
if (m_PullingToPoint) {
|
||||
const auto source = GetCurrentWaypoint();
|
||||
@ -407,6 +422,4 @@ void MovementAIComponent::SetMaxSpeed(const float value) {
|
||||
m_Acceleration = value / 5;
|
||||
}
|
||||
|
||||
void MovementAIComponent::HandleWaypointArrived() {
|
||||
|
||||
}
|
||||
#include "MovementAIComponentAronwk.cpp"
|
||||
|
@ -53,7 +53,7 @@ struct MovementAIInfo {
|
||||
|
||||
/**
|
||||
* Component that handles the movement settings of an entity. Not to be confused with the BaseCombatAI component that
|
||||
* actually handles attackig and following enemy entities.
|
||||
* actually handles attacking and following enemy entities.
|
||||
*/
|
||||
class MovementAIComponent : public Component {
|
||||
public:
|
||||
@ -195,6 +195,8 @@ public:
|
||||
|
||||
void HandleWaypointArrived();
|
||||
|
||||
void SetupPath(const std::string& pathname);
|
||||
|
||||
/**
|
||||
* Stops the current movement and moves the entity to a certain point. Will continue until it's close enough,
|
||||
* after which its AI is enabled again.
|
||||
|
7
dGame/dComponents/MovementAIComponentAronwk.cpp
Normal file
7
dGame/dComponents/MovementAIComponentAronwk.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef MOVEMENTAICOMPONENT_H
|
||||
#include "MovementAIComponent.h"
|
||||
#endif
|
||||
|
||||
void MovementAIComponent::HandleWaypointArrived() {
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user