mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-11-26 11:18:16 +00:00
Fixed speed stuff
Should be tested more.
This commit is contained in:
@@ -154,6 +154,19 @@ public:
|
||||
*/
|
||||
NiPoint3 GetNextWaypoint() const { return m_NextWaypoint; }
|
||||
|
||||
NiPoint3 GetNextPathWaypoint() const {
|
||||
if (m_CurrentPath.empty()) return GetNextWaypoint();
|
||||
if (m_IsInReverse) {
|
||||
return m_CurrentPathWaypointIndex - 1 < 0 ?
|
||||
m_CurrentPath.front() :
|
||||
m_CurrentPath.at(m_CurrentPathWaypointIndex - 1);
|
||||
} else {
|
||||
return m_CurrentPathWaypointIndex + 1 >= m_CurrentPath.size() ?
|
||||
m_CurrentPath.back() :
|
||||
m_CurrentPath.at(m_CurrentPathWaypointIndex + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the approximate current location of the entity, including y coordinates
|
||||
* @return the approximate current location of the entity
|
||||
@@ -198,6 +211,8 @@ public:
|
||||
|
||||
void SetupPath(const std::string& pathname);
|
||||
|
||||
float GetCurrentPathWaypointSpeed() const;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
||||
Reference in New Issue
Block a user