implement sensor range requirements

This commit is contained in:
2026-04-29 21:01:41 +02:00
parent 58b7cda21c
commit b0320ac117
9 changed files with 178 additions and 30 deletions

View File

@@ -804,23 +804,7 @@ void GameWorldView::drawDebugSensorRanges(QPainter& painter)
m_visuals->ships.find(role);
if (it == m_visuals->ships.end()) { continue; }
float range = 0.0f;
if (ship.weapon.has_value())
{
range = ship.weapon->range;
}
else if (ship.repairTool.has_value())
{
range = ship.repairTool->range;
}
else if (ship.cargo.has_value())
{
range = ship.cargo->collectionRange * 5.0f;
}
else
{
continue;
}
const float range = ship.sensorRange;
const QPointF center = worldToWidget(ship.position);
const qreal radiusPx = static_cast<qreal>(range)