The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: ACarlotti on July 13, 2018, 05:51:04 PM

Title: Network map should allow filtering by players with negative net wealth
Post by: ACarlotti on July 13, 2018, 05:51:04 PM
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.

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.)
Title: Re: Network map should allow filtering by players with negative net wealth
Post by: Dwachs on July 13, 2018, 07:15:59 PM
thanks, in r8544