Fix elevation calculation and polar snowline threshold preventing unit movement
This commit is contained in:
+7
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user