@@ -807,8 +807,7 @@ bool GamePlayer::FindWarehouseForJob(const Job job, noRoadNode& goal) const
807807 // Optimization: return early if building is isolated
808808 if (goal.GetType () == NodalObjectType::Building || goal.GetType () == NodalObjectType::Buildingsite)
809809 {
810- auto * bld = static_cast <noBaseBuilding*>(&goal);
811- if (!bld->IsConnected ())
810+ if (!static_cast <noBaseBuilding&>(goal).IsConnected ())
812811 return false ;
813812 }
814813
@@ -1034,7 +1033,7 @@ noBaseBuilding* GamePlayer::FindClientForWare(const Ware& ware)
10341033 // Bei Baustellen die Extraliste abfragen
10351034 for (noBuildingSite* bldSite : buildings.GetBuildingSites ())
10361035 {
1037- // Optimization: return early if building is isolated
1036+ // Optimization: Ignore if unconnected
10381037 if (!bldSite->IsConnected ())
10391038 continue ;
10401039
@@ -1051,7 +1050,7 @@ noBaseBuilding* GamePlayer::FindClientForWare(const Ware& ware)
10511050 // Für übrige Gebäude
10521051 for (nobUsual* bld : buildings.GetBuildings (bldType))
10531052 {
1054- // Optimization: return early if building is isolated
1053+ // Optimization: Ignore if unconnected
10551054 if (!bld->IsConnected ())
10561055 continue ;
10571056
@@ -1156,7 +1155,7 @@ nobBaseMilitary* GamePlayer::FindClientForCoin(const Ware& ware) const
11561155 // Militärgebäude durchgehen
11571156 for (nobMilitary* milBld : buildings.GetMilitaryBuildings ())
11581157 {
1159- // Optimization: return early if building is isolated
1158+ // Optimization: Ignore if unconnected
11601159 if (!milBld->IsConnected ())
11611160 continue ;
11621161
0 commit comments