Skip to content

Commit 9abcba1

Browse files
committed
Allow nobHarborBuilding::WareLost during destruction
This is a corner case when destroying the harbor leads to defeat which leads to sinking ships potentially with wares to this building.
1 parent 4fc51db commit 9abcba1

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

libs/s25main/buildings/nobHarborBuilding.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,7 @@ void nobHarborBuilding::StopExplorationExpedition()
435435
/// Bestellt die zusätzlichen erforderlichen Waren für eine Expedition
436436
void nobHarborBuilding::OrderExpeditionWares()
437437
{
438-
RTTR_Assert(!IsBeingDestroyedNow()); // Wares should already be canceled!
439-
if(this->IsBeingDestroyedNow()) // don't order new stuff if we are about to be destroyed
438+
if(IsBeingDestroyedNow()) // don't order new stuff if we are about to be destroyed
440439
return;
441440

442441
if(!expedition.active) // expedition no longer active?
@@ -490,11 +489,8 @@ void nobHarborBuilding::OrderExpeditionWares()
490489
orderware_ev = GetEvMgr().AddEvent(this, 210, 10);
491490
}
492491

493-
/// Eine bestellte Ware konnte doch nicht kommen
494492
void nobHarborBuilding::WareLost(Ware& ware)
495493
{
496-
RTTR_Assert(!IsBeingDestroyedNow());
497-
// ggf. neue Waren für Expedition bestellen
498494
if(expedition.active && (ware.type == GoodType::Boards || ware.type == GoodType::Stones))
499495
OrderExpeditionWares();
500496
nobBaseWarehouse::WareLost(ware);

0 commit comments

Comments
 (0)