Skip to content

Commit 250aea5

Browse files
committed
no revenue when overcrowded. change revenue calculation method
1 parent d4cd8dd commit 250aea5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

simhalt.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,9 @@ void haltestelle_t::book_pax_boarding_revenue(uint16 boarded_pax)
15271527
if( base <= 0 || boarded_pax == 0 ) {
15281528
return;
15291529
}
1530+
if( is_overcrowded( goods_manager_t::passengers->get_index() ) ) {
1531+
return;
1532+
}
15301533
// Sum level contributions only from buildings that can handle passengers
15311534
// (enabled == NOT_ENABLED means all goods; enabled & PAX means explicitly passenger-capable).
15321535
// Buildings that only handle post or freight are excluded.
@@ -1538,13 +1541,13 @@ void haltestelle_t::book_pax_boarding_revenue(uint16 boarded_pax)
15381541
const uint8 enabled = desc->get_enabled();
15391542
if( enabled == NOT_ENABLED || (enabled & PAX) ) {
15401543
sint32 lv = (sint32)desc->get_level() - 3;
1541-
if( lv > 0 ) { capacity_factor += lv; }
1544+
if( lv > 0 ) { capacity_factor += min(lv / 2 + 1, 2); }
15421545
}
15431546
}
15441547
}
15451548
}
15461549
if( capacity_factor > 0 ) {
1547-
sint64 revenue = (sint64)base * capacity_factor * (sint64)boarded_pax;
1550+
sint64 revenue = (sint64)base * capacity_factor * (sint64)boarded_pax / 10000;
15481551
owner->book_revenue( revenue, get_basis_pos(), ignore_wt, goods_manager_t::passengers->get_index() );
15491552
financial_history[0][HALT_REVENUE] += revenue;
15501553
}

0 commit comments

Comments
 (0)