mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
Fixes for multiple new issues from Sonar
This commit is contained in:
@@ -783,7 +783,7 @@ void CZonePlacer::moveOneZone(TZoneMap& zones, TForceVector& totalForces, TDista
|
||||
//Move one zone towards most distant zone to reduce distance
|
||||
|
||||
float maxDistance = 0;
|
||||
for (auto con : misplacedZone->getConnections())
|
||||
for (const auto & con : misplacedZone->getConnections())
|
||||
{
|
||||
if (con.getConnectionType() == rmg::EConnectionType::REPULSIVE)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ void ObjectManager::init()
|
||||
// Consider only connected zones
|
||||
auto id = zone.getId();
|
||||
std::set<TRmgTemplateZoneId> connectedZones;
|
||||
for(auto c : map.getMapGenOptions().getMapTemplate()->getConnectedZoneIds())
|
||||
for(const auto & c : map.getMapGenOptions().getMapTemplate()->getConnectedZoneIds())
|
||||
{
|
||||
// Only consider connected zones
|
||||
if (c.getZoneA() == id || c.getZoneB() == id)
|
||||
|
||||
Reference in New Issue
Block a user