Skip to content

Commit 1b0c7d5

Browse files
committed
Swap positions for brain-to-orbit is orbit is below us
1 parent e99eeaa commit 1b0c7d5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Source/Menus/SceneEditorGUI.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,8 +1413,15 @@ void SceneEditorGUI::UpdateBrainSkyPathAndCost(Vector brainPos) {
14131413
}
14141414
}
14151415

1416+
Vector pos1 = orbitPos;
1417+
Vector pos2 = brainPos;
1418+
if (pos1.GetY() > pos2.GetY())
1419+
{
1420+
std::swap(pos1, pos2);
1421+
}
1422+
14161423
Activity::Teams team = static_cast<Activity::Teams>(g_ActivityMan.GetActivity()->GetTeamOfPlayer(m_pController->GetPlayer()));
1417-
m_PathRequest = g_SceneMan.GetScene()->CalculatePathAsync(orbitPos, brainPos, c_PathFindingDefaultDigStrength, team,
1424+
m_PathRequest = g_SceneMan.GetScene()->CalculatePathAsync(pos1, pos2, c_PathFindingDefaultDigStrength, team,
14181425
[&](std::shared_ptr<volatile PathRequest> pathRequest) {
14191426
m_BrainSkyPath = const_cast<std::list<Vector>&>(pathRequest->path);
14201427
m_BrainSkyPathCost = pathRequest->totalCost;

0 commit comments

Comments
 (0)