Fix elevation calculation and polar snowline threshold preventing unit movement
This commit is contained in:
@@ -7,8 +7,8 @@ mountain_rock_height_km: 2.3 # Height in km >= 2.3 is rocky mountain
|
|||||||
snow_height_km: 3.1 # Altitude in km >= 3.1 is high peak snow
|
snow_height_km: 3.1 # Altitude in km >= 3.1 is high peak snow
|
||||||
polar_snow_line_enabled: true # Whether latitude reduces snowline altitude
|
polar_snow_line_enabled: true # Whether latitude reduces snowline altitude
|
||||||
polar_snow_line_base_km: 2.5 # Base snowline at temperate latitudes
|
polar_snow_line_base_km: 2.5 # Base snowline at temperate latitudes
|
||||||
polar_snow_factor_start: 0.40 # Latitude distFromCenter where polar cooling starts
|
polar_snow_factor_start: 0.88 # Latitude distFromCenter where polar cooling starts (polar caps only)
|
||||||
polar_snow_factor_end: 0.85 # Latitude distFromCenter where sea-level snowline is reached
|
polar_snow_factor_end: 0.98 # Latitude distFromCenter where sea-level snowline is reached
|
||||||
|
|
||||||
# Slope and elevation movement penalties
|
# Slope and elevation movement penalties
|
||||||
# Elevation difference (deltaH in km) between hex centers
|
# Elevation difference (deltaH in km) between hex centers
|
||||||
|
|||||||
+7
-2
@@ -1546,9 +1546,14 @@ void QSceneRenderer::mousePressEvent(QMouseEvent *event)
|
|||||||
update();
|
update();
|
||||||
return;
|
return;
|
||||||
} else if (event->button() == Qt::RightButton) {
|
} 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) {
|
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();
|
update();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ TerrainMovementConfig::TerrainMovementConfig()
|
|||||||
snowHeightKm(3.1f),
|
snowHeightKm(3.1f),
|
||||||
polarSnowLineEnabled(true),
|
polarSnowLineEnabled(true),
|
||||||
polarSnowLineBaseKm(2.5f),
|
polarSnowLineBaseKm(2.5f),
|
||||||
polarSnowFactorStart(0.40f),
|
polarSnowFactorStart(0.88f),
|
||||||
polarSnowFactorEnd(0.85f),
|
polarSnowFactorEnd(0.98f),
|
||||||
uphillSlopeMultiplier(4.0f),
|
uphillSlopeMultiplier(4.0f),
|
||||||
downhillSlopeBonusMultiplier(2.0f),
|
downhillSlopeBonusMultiplier(2.0f),
|
||||||
minStepCost(0.25f),
|
minStepCost(0.25f),
|
||||||
@@ -143,7 +143,7 @@ QString TerrainMovementManager::getTerrainType(int tx, int ty, Matrix2D<TerrainP
|
|||||||
return "water";
|
return "water";
|
||||||
}
|
}
|
||||||
|
|
||||||
float heightKm = (tp.height / 255.0f) * 3.5f + 1.0f;
|
float heightKm = (tp.height / 255.0f) * 3.5f;
|
||||||
|
|
||||||
// 2. High peak snow
|
// 2. High peak snow
|
||||||
if (heightKm >= m_config.snowHeightKm) {
|
if (heightKm >= m_config.snowHeightKm) {
|
||||||
|
|||||||
Reference in New Issue
Block a user