Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions Source/Entities/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,19 @@ namespace RTE {
/// @param m_MovePath.push_back(newCoordinate The new coordinate to add to the end of the MovePath.
void AddToMovePathEnd(Vector newCoordinate) { m_MovePath.push_back(newCoordinate); }

/// Gets the last position in this Actor's move path.
/// @return The last position in this Actor's move path.
Vector GetMovePathEnd() const { return m_MovePath.back(); }
/// Gets the last position in this Actor's move path, or otherwise the current move target.
/// @return The last position in this Actor's move path, or otherwise the current move target.
Vector GetMovePathEnd() const {
if (!m_MovePath.empty()) {
return m_MovePath.back();
}
// In case move path is empty, check our own path request.
if (m_PathRequest) {
return const_cast<Vector&>(m_PathRequest->targetPos);
}
// In case *that* is empty, just return the move target.
return m_MoveTarget;
}

/// Removes a coordinate from the beginning of the MovePath, meaning the
/// one closest to this Actor.
Expand Down
Loading