Skip to content

Commit 3147f7d

Browse files
authored
Merge branch 'development' into patch-2
2 parents 8b2dae3 + 01fb6b0 commit 3147f7d

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Source/Entities/Actor.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,19 @@ namespace RTE {
445445
/// @param m_MovePath.push_back(newCoordinate The new coordinate to add to the end of the MovePath.
446446
void AddToMovePathEnd(Vector newCoordinate) { m_MovePath.push_back(newCoordinate); }
447447

448-
/// Gets the last position in this Actor's move path.
449-
/// @return The last position in this Actor's move path.
450-
Vector GetMovePathEnd() const { return m_MovePath.back(); }
448+
/// Gets the last position in this Actor's move path, or otherwise the current move target.
449+
/// @return The last position in this Actor's move path, or otherwise the current move target.
450+
Vector GetMovePathEnd() const {
451+
if (!m_MovePath.empty()) {
452+
return m_MovePath.back();
453+
}
454+
// In case move path is empty, check our own path request.
455+
if (m_PathRequest) {
456+
return const_cast<Vector&>(m_PathRequest->targetPos);
457+
}
458+
// In case *that* is empty, just return the move target.
459+
return m_MoveTarget;
460+
}
451461

452462
/// Removes a coordinate from the beginning of the MovePath, meaning the
453463
/// one closest to this Actor.

Source/Entities/PieMenu.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,10 @@ PieSlice* PieMenu::RemovePieSlice(const PieSlice* pieSliceToRemove) {
403403
if (PieMenu* removedPieSliceSubPieMenu = removedPieSlice->GetSubPieMenu()) {
404404
removedPieSliceSubPieMenu->SetEnabled(false);
405405
removedPieSliceSubPieMenu->SetOwner(nullptr);
406+
407+
if (removedPieSliceSubPieMenu == m_ActiveSubPieMenu) {
408+
m_ActiveSubPieMenu = nullptr;
409+
}
406410
}
407411
RepopulateAndRealignCurrentPieSlices();
408412
}

0 commit comments

Comments
 (0)