The International Simutrans Forum

 

Author Topic: Network map should allow filtering by players with negative net wealth  (Read 288 times)

0 Members and 1 Guest are viewing this topic.

Offline ACarlotti

  • *
  • Posts: 344
At the moment the network map only allows filtering by players with positive net wealth. This patch (taken from Extended, so line numbers are probably wrong) fixes this bug, allowing filtering by any player with convoys.
Code: [Select]
diff --git a/gui/map_frame.cc b/gui/map_frame.cc
index ef1e47900..dd3a89a39 100644
--- a/gui/map_frame.cc
+++ b/gui/map_frame.cc
@@ -239,7 +239,7 @@ map_frame_t::map_frame_t() :
        viewed_player_c.append_element( new gui_scrolled_list_t::const_text_scrollitem_t(translator::translate("All"), COL_BLACK));
        viewable_players[ 0 ] = -1;
        for(  int np = 0, count = 1;  np < MAX_PLAYER_COUNT;  np++  ) {
-               if(  welt->get_player( np )  &&  welt->get_player( np )->has_money_or_assets()) {
+               if(  welt->get_player( np )  &&  welt->get_player( np )->get_finance()->has_convoi()  ) {
                        viewed_player_c.append_element( new gui_scrolled_list_t::const_text_scrollitem_t(welt->get_player( np )->get_name(), welt->get_player( np )->get_player_color1()+4));
                        viewable_players[ count++ ] = np;
                }
(I think the function "has_money_or_assets" is misleadingly named, and this probably contributed to the bug arising in the first place.)

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4555
  • Languages: EN, DE, AT
thanks, in r8544