Skip to content

Commit d7e98eb

Browse files
committed
Translate comments in nobHarborBuilding
1 parent 378cc04 commit d7e98eb

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

libs/s25main/buildings/nobHarborBuilding.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -675,25 +675,25 @@ void nobHarborBuilding::AddWare(std::unique_ptr<Ware> ware)
675675
}
676676
// When ware should be transported to any other goal we returned above, so now we need to take it
677677

678-
// Brauchen wir die Ware?
678+
// Do we need the ware for an expedition?
679679
if(expedition.active)
680680
{
681681
if((ware->type == GoodType::Boards && expedition.boards < BUILDING_COSTS[BuildingType::HarborBuilding].boards)
682682
|| (ware->type == GoodType::Stones
683683
&& expedition.stones < BUILDING_COSTS[BuildingType::HarborBuilding].stones))
684684
{
685+
// Don't wait for it any longer if it had a goal, i.e. us.
686+
// Without a goal it was a "lost" ware.
687+
if(ware->GetGoal())
688+
RemoveDependentWare(*ware);
689+
// Add to expedition
690+
world->GetPlayer(player).RemoveWare(*ware);
685691
if(ware->type == GoodType::Boards)
686692
++expedition.boards;
687693
else
688694
++expedition.stones;
689695

690-
// Ware nicht mehr abhängig
691-
if(ware->GetGoal())
692-
RemoveDependentWare(*ware);
693-
// Dann zweigen wir die einfach mal für die Expedition ab
694-
world->GetPlayer(player).RemoveWare(*ware);
695-
696-
// Ggf. ist jetzt alles benötigte da
696+
// Could be ready now
697697
CheckExpeditionReady();
698698
return;
699699
}

tests/s25Main/integration/testSeafaring.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,11 +653,10 @@ BOOST_FIXTURE_TEST_CASE(AddWareWithUnreachableGoalToHarbor, ShipAndHarborsReadyF
653653
// 3. Ware reaches harbor and needs to be carried into a storehouse
654654
// 4. Harbor itself does not accept the ware so another storehouse must be found
655655
GamePlayer& player = world.GetPlayer(curPlayer);
656-
auto& harbors = player.GetBuildingRegister().GetHarbors();
656+
const auto& harbors = player.GetBuildingRegister().GetHarbors();
657657
BOOST_TEST_REQUIRE(harbors.size() >= 2u);
658658
nobHarborBuilding& harbor1 = *harbors.front();
659659
nobHarborBuilding& harbor2 = **(++harbors.begin());
660-
auto& hq = *player.GetFirstWH();
661660
auto* wh = static_cast<nobBaseWarehouse*>(BuildingFactory::CreateBuilding(
662661
world, BuildingType::Storehouse, harbor2.GetPos() + MapPoint(2, 0), curPlayer, Nation::Romans));
663662
BOOST_TEST_REQUIRE(wh);

0 commit comments

Comments
 (0)