Fix elevation calculation and polar snowline threshold preventing unit movement

This commit is contained in:
bart
2026-11-08 20:44:55 +01:00
parent df6eac62ca
commit 9fe4a631e4
3 changed files with 12 additions and 7 deletions
+7 -2
View File
@@ -1546,9 +1546,14 @@ void QSceneRenderer::mousePressEvent(QMouseEvent *event)
update();
return;
} else if (event->button() == Qt::RightButton) {
// Right click: Move selected unit directly to hex!
// Right click: Attack enemy unit or move selected unit directly to hex!
if (selected) {
GameManager::instance().commandMoveSelected(hitX, hitY, m_point, m_numPoints05);
Unit *enemy = GameManager::instance().getUnitAt(hitX, hitY);
if (enemy && enemy->playerId != selected->playerId) {
GameManager::instance().commandAttack(enemy);
} else {
GameManager::instance().commandMoveSelected(hitX, hitY, m_point, m_numPoints05);
}
update();
return;
}