Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: extend the allowed range for max loan setting #8386

Merged
merged 1 commit into from Dec 16, 2020

Conversation

ldpl
Copy link
Contributor

@ldpl ldpl commented Dec 15, 2020

From 100000 - 500000 to 0 - 2000000000.
0 to allow gamescripts do game modes without loan. 2000000000 since it's enough for all forseable reasons and int32 is the max settings gui currently supports (well, it was a bit less but I fixed that). Also fixed gui overflow with iranian rials while at it.

Copy link
Member

@TrueBrain TrueBrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor coding style blabla :D

Other than that, I am totally fine with a patch like this.

src/company_cmd.cpp Outdated Show resolved Hide resolved
src/settings_gui.cpp Outdated Show resolved Hide resolved
@TrueBrain TrueBrain added candidate: yes This Pull Request is a candidate for being merged size: trivial This Pull Request is trivial labels Dec 15, 2020
@TrueBrain TrueBrain added the preview This PR is receiving preview builds label Dec 15, 2020
@DorpsGek DorpsGek temporarily deployed to preview-pr-8386 December 15, 2020 22:17 Inactive
@DorpsGek DorpsGek temporarily deployed to preview-pr-8386 December 15, 2020 23:34 Inactive
@ldpl
Copy link
Contributor Author

ldpl commented Dec 15, 2020

For the record, I changed tests because for whatever reason max_loan is actually 2000000000 in the test savegame so it wasn't even a valid value before.
Here are all the settings in the regression/test.sav atm:

            'settings': {'_old_vds.servint_aircraft': 100,
                         '_old_vds.servint_ispercent': False,
                         '_old_vds.servint_roadveh': 150,
                         '_old_vds.servint_ships': 360,
                         '_old_vds.servint_trains': 150,
                         'ai.ai_disable_veh_aircraft': False,
                         'ai.ai_disable_veh_roadveh': False,
                         'ai.ai_disable_veh_ship': False,
                         'ai.ai_disable_veh_train': False,
                         'ai.ai_in_multiplayer': False,
                         'construction.autoslope': True,
                         'construction.build_on_slopes': True,
                         'construction.extra_dynamite': False,
                         'construction.raw_industry_construction': 0,
                         'construction.road_stop_on_town_road': False,
                         'construction.train_signal_side': 1,
                         'diff_level': 3,
                         'difficulty.competitor_speed': 2,
                         'difficulty.construction_cost': 0,
                         'difficulty.disasters': False,
                         'difficulty.economy': False,
                         'difficulty.industry_density': 4,
                         'difficulty.initial_interest': 2,
                         'difficulty.line_reverse_mode': False,
                         'difficulty.max_loan': 2000000000,
                         'difficulty.max_no_competitors': 1,
                         'difficulty.number_towns': 2,
                         'difficulty.quantity_sea_lakes': 0,
                         'difficulty.subsidy_multiplier': 2,
                         'difficulty.terrain_type': 1,
                         'difficulty.town_council_tolerance': 0,
                         'difficulty.vehicle_breakdowns': 1,
                         'difficulty.vehicle_costs': 0,
                         'economy.allow_shares': True,
                         'economy.bribe': True,
                         'economy.dist_local_authority': 20,
                         'economy.exclusive_rights': True,
                         'economy.give_money': True,
                         'economy.inflation': True,
                         'economy.initial_city_size': 2,
                         'economy.larger_towns': 4,
                         'economy.mod_road_rebuild': False,
                         'economy.multiple_industry_per_town': False,
                         'economy.smooth_economy': True,
                         'economy.station_noise_level': False,
                         'economy.town_growth_rate': 2,
                         'economy.town_layout': 1,
                         'economy.town_noise_population[0]': 800,
                         'economy.town_noise_population[1]': 2000,
                         'economy.town_noise_population[2]': 4000,
                         'game_creation.generation_seed': 0,
                         'game_creation.land_generator': 1,
                         'game_creation.landscape': 0,
                         'game_creation.oil_refinery_limit': 16,
                         'game_creation.snow_line_height': 7,
                         'game_creation.starting_year': 1950,
                         'game_creation.tgen_smoothness': 1,
                         'game_creation.town_name': 0,
                         'game_creation.tree_placer': 2,
                         'locale.currency': 0,
                         'null.1': None,
                         'null.10': None,
                         'null.11': None,
                         'null.12': None,
                         'null.13': None,
                         'null.2': None,
                         'null.3': None,
                         'null.4': None,
                         'null.5': None,
                         'null.6': None,
                         'null.7': None,
                         'null.8': None,
                         'null.9': None,
                         'old_ending_year_slv_105': 0,
                         'order.gradual_loading': True,
                         'order.improved_load': False,
                         'order.no_servicing_if_no_breakdowns': False,
                         'order.selectgoods': True,
                         'order.serviceathelipad': True,
                         'pf.forbid_90_deg': False,
                         'pf.npf.npf_buoy_penalty': 200,
                         'pf.npf.npf_crossing_penalty': 300,
                         'pf.npf.npf_max_search_nodes': 10000,
                         'pf.npf.npf_rail_curve_penalty': 1,
                         'pf.npf.npf_rail_depot_reverse_penalty': 5000,
                         'pf.npf.npf_rail_firstred_exit_penalty': 10000,
                         'pf.npf.npf_rail_firstred_penalty': 1000,
                         'pf.npf.npf_rail_lastred_penalty': 1000,
                         'pf.npf.npf_rail_pbs_cross_penalty': 300,
                         'pf.npf.npf_rail_pbs_signal_back_penalty': 1500,
                         'pf.npf.npf_rail_slope_penalty': 100,
                         'pf.npf.npf_rail_station_penalty': 100,
                         'pf.npf.npf_road_curve_penalty': 1,
                         'pf.npf.npf_road_drive_through_penalty': 800,
                         'pf.npf.npf_water_curve_penalty': 25,
                         'pf.path_backoff_interval': 20,
                         'pf.pathfinder_for_roadvehs': 2,
                         'pf.pathfinder_for_ships': 0,
                         'pf.pathfinder_for_trains': 2,
                         'pf.reserve_paths': False,
                         'pf.roadveh_queue': True,
                         'pf.wait_for_pbs_path': 30,
                         'pf.wait_oneway_signal': 15,
                         'pf.wait_twoway_signal': 41,
                         'pf.yapf.disable_node_optimization': False,
                         'pf.yapf.max_search_nodes': 10000,
                         'pf.yapf.rail_crossing_penalty': 300,
                         'pf.yapf.rail_curve45_penalty': 100,
                         'pf.yapf.rail_curve90_penalty': 600,
                         'pf.yapf.rail_depot_reverse_penalty': 5000,
                         'pf.yapf.rail_doubleslip_penalty': 100,
                         'pf.yapf.rail_firstred_exit_penalty': 10000,
                         'pf.yapf.rail_firstred_penalty': 1000,
                         'pf.yapf.rail_firstred_twoway_eol': True,
                         'pf.yapf.rail_lastred_exit_penalty': 10000,
                         'pf.yapf.rail_lastred_penalty': 1000,
                         'pf.yapf.rail_longer_platform_penalty': 800,
                         'pf.yapf.rail_longer_platform_per_tile_penalty': 0,
                         'pf.yapf.rail_look_ahead_max_signals': 10,
                         'pf.yapf.rail_look_ahead_signal_p0': 500,
                         'pf.yapf.rail_look_ahead_signal_p1': -100,
                         'pf.yapf.rail_look_ahead_signal_p2': 5,
                         'pf.yapf.rail_pbs_cross_penalty': 300,
                         'pf.yapf.rail_pbs_signal_back_penalty': 1500,
                         'pf.yapf.rail_pbs_station_penalty': 800,
                         'pf.yapf.rail_shorter_platform_penalty': 4000,
                         'pf.yapf.rail_shorter_platform_per_tile_penalty': 0,
                         'pf.yapf.rail_slope_penalty': 200,
                         'pf.yapf.rail_station_penalty': 3000,
                         'pf.yapf.road_crossing_penalty': 300,
                         'pf.yapf.road_curve_penalty': 100,
                         'pf.yapf.road_slope_penalty': 200,
                         'pf.yapf.road_stop_penalty': 800,
                         'station.adjacent_stations': True,
                         'station.modified_catchment': True,
                         'station.never_expire_airports': False,
                         'station.station_spread': 12,
                         'units': 1,
                         'vehicle.disable_elrails': False,
                         'vehicle.dynamic_engines': False,
                         'vehicle.extend_vehicle_life': 0,
                         'vehicle.freight_trains': 1,
                         'vehicle.max_aircraft': 200,
                         'vehicle.max_roadveh': 500,
                         'vehicle.max_ships': 300,
                         'vehicle.max_trains': 500,
                         'vehicle.never_expire_vehicles': False,
                         'vehicle.plane_speed': 2,
                         'vehicle.road_side': 1,
                         'vehicle.train_acceleration_model': 0,
                         'vehicle.wagon_speed_limits': True}}

@glx22
Copy link
Contributor

glx22 commented Dec 16, 2020

I did some digging and found f381b91. But still doesn't explain why the value in the savegame is not in the original range.

Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird old save games be weird

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate: yes This Pull Request is a candidate for being merged preview This PR is receiving preview builds size: trivial This Pull Request is trivial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants