Commit Graph

454 Commits

Author SHA1 Message Date
Jonathan G Rennison
ae9b416684 Merge branch 'master' into jgrpp
# Conflicts:
#	src/ai/ai_core.cpp
#	src/ai/ai_gui.cpp
#	src/ai/ai_instance.cpp
#	src/console_cmds.cpp
#	src/engine_type.h
#	src/game/game_gui.cpp
#	src/game/game_instance.cpp
#	src/goal.cpp
#	src/goal_cmd.h
#	src/lang/english.txt
#	src/lang/estonian.txt
#	src/network/network_client.cpp
#	src/newgrf.cpp
#	src/newgrf_generic.h
#	src/openttd.cpp
#	src/saveload/saveload.h
#	src/script/api/script_log.cpp
#	src/script/api/script_town.cpp
#	src/settings_table.cpp
#	src/station_cmd.cpp
#	src/station_cmd.h
#	src/station_map.h
#	src/strings.cpp
#	src/table/settings/difficulty_settings.ini
#	src/table/settings/gui_settings.ini
#	src/tbtr_template_gui_main.h
#	src/timetable_cmd.cpp
#	src/timetable_cmd.h
#	src/timetable_gui.cpp
#	src/town_gui.cpp
#	src/train_gui.cpp
#	src/water_cmd.cpp
2023-02-11 23:05:22 +00:00
SamuXarick
231935fccd Change: Show buy company dialog window even when playing in the AI company 2023-02-11 09:43:47 +01:00
SamuXarick
43ce73db86 Fix: [Script] Use Money instead of int32 for presenting the value of a company to AIs 2023-02-11 09:43:47 +01:00
glx22
b080f24bd8 Codechange: move windows common to AI and GS out of ai_gui 2023-02-05 19:27:25 +01:00
Rubidium
b7b7c11b90 Change #10077: make maximum loan a positive multiple of the loan interval
And set the minimum maximum loan to the value of loan interval, so there is
always an amount of money to lend. Compared to being allowed to set max loan
to 0 and never be allowed to lend any money.
2023-02-01 21:41:18 +01:00
Rubidium
4e65ec1dc4 Codechange: do not declare functions in blocks 2023-01-29 20:28:45 +01:00
Jonathan G Rennison
1bfd96c7f2 Merge branch 'master' into jgrpp
# Conflicts:
#	src/3rdparty/fmt/core.h
#	src/command_type.h
#	src/console_cmds.cpp
#	src/core/overflowsafe_type.hpp
#	src/landscape.cpp
#	src/network/network.cpp
#	src/newgrf_object.h
#	src/object_cmd.cpp
#	src/order_gui.cpp
#	src/saveload/vehicle_sl.cpp
#	src/script/api/script_industrytype.cpp
#	src/script/api/script_object.hpp
#	src/script/api/script_town.cpp
#	src/table/object_land.h
#	src/timetable_cmd.cpp
#	src/tree_cmd.cpp
#	src/vehicle_gui.cpp
#	src/window.cpp
2023-01-15 19:28:37 +00:00
Rubidium
b3b8c3fd2d Codechange: pass the randomizer to use directly to the company face generation 2023-01-14 22:00:11 +01:00
Jonathan G Rennison
f32733ef22 Command: Replace binary_length field with auxiliary data
Use for CMD_ADD_PLAN_LINE
2022-12-07 21:14:34 +00:00
Jonathan G Rennison
1e769d050f Leave PLYP chunk unchanged when loading/saving server saves in non-MP 2022-11-17 00:40:12 +00:00
Tyler Trahan
89a2d0a605
Fix #10154: Don't inconsistently set random company face in network games (#10157) 2022-11-13 11:30:46 -05:00
Tyler Trahan
1e0d5998db Fix #10154: Don't inconsistently set random company face in network games
(cherry picked from commit 638b75d4763a412085157eea7e09e9d74db268cd)
2022-11-12 16:20:19 +00:00
Jonathan G Rennison
3b7352132b Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_cmd.cpp
#	src/console_cmds.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/screenshot.cpp
#	src/settings_gui.cp
2022-11-10 19:48:14 +00:00
SamuXarick
60ccab3c52
Fix #9908: Close company windows only after all its infrastructure is removed (#9912) 2022-11-08 09:44:17 -05:00
SamuXarick
8c4a70e05e
Fix: Refresh company window when switching companies (#9910) 2022-11-07 17:54:04 -05:00
Tyler Trahan
3d45bc4abe Feature: Build objects by area 2022-10-16 18:28:08 +02:00
Jonathan G Rennison
ac1071f4fc Merge branch 'master' into jgrpp
# Conflicts:
#	src/station_cmd.cpp
#	src/vehicle_gui.cpp
2022-09-21 18:07:02 +01:00
Tyler Trahan
07443969f9 Fix ca19a0d: Network hosts also use favorite face 2022-09-21 12:39:07 +02:00
Tyler Trahan
6d84b1e108 Fix ca19a0d: Send the proper network command when loading favorite face 2022-09-21 12:39:07 +02:00
Jonathan G Rennison
175ef00985 Avoid dangling company purchase timeout when no clients connected to company 2022-09-16 16:05:17 +01:00
Jonathan G Rennison
ad9d593a51 Fix assertion failure setting player face for new company in multiplayer
See: https://github.com/OpenTTD/OpenTTD/issues/10016
2022-09-10 10:55:29 +01:00
Jonathan G Rennison
3d857333c8 Reduce delays with company bankrupcty/sale processing at high day lengths 2022-09-02 18:14:35 +01:00
Jonathan G Rennison
23fa7cd239 Improve handling of company sales
Avoid conflicts between bankruptcy and manual company sale paths
2022-09-02 18:13:47 +01:00
Jonathan G Rennison
dc5e073379 Merge branch 'master' into jgrpp 2022-08-30 19:39:22 +01:00
Tyler Trahan
788b06fe0f
Change: New player companies use favorite manager face, if saved (#9895) 2022-08-30 16:26:02 +02:00
Jonathan G Rennison
5b7db9d849 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/commit-checker.yml
#	src/command.cpp
#	src/company_cmd.cpp
#	src/company_gui.cpp
#	src/crashlog.cpp
#	src/economy.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/misc_gui.cpp
#	src/newgrf_config.cpp
#	src/openttd.cpp
#	src/settings_gui.cpp
#	src/ship_cmd.cpp
#	src/table/settings/gui_settings.ini
2022-05-15 13:54:13 +01:00
Tyler Trahan
ec90fb4c99 Fix #6544: Don't join AI company when loading network game in singleplayer 2022-04-30 19:36:09 +02:00
Tyler Trahan
f4ca94d3f6 Codechange: Revenue is not the same as Income
Income is revenue minus costs. Let's name things correctly (without breaking the script API).
2022-04-25 21:51:51 +02:00
Rubidium
c73f578e8c Codechange: replace magic numbers and C-style arrays with C++-style array for share owners 2022-03-09 18:05:12 +01:00
J0anJosep
d9a37c915f Cleanup #9725: Replace cmd_helper related functions and remove cmd_helper.h. 2022-02-02 21:30:15 +01:00
Michael Lutz
13528bfcd0 Codechange: Un-bitstuff all remaining commands. 2021-12-16 22:28:32 +01:00
Michael Lutz
4f3ea3907e Codechange: Un-bitstuff commands taking a ClientID (i.e. CMD_CLIENT_ID). 2021-12-16 22:28:32 +01:00
Michael Lutz
0f64ee5ce1 Codechange: Template DoCommandP to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2021-12-16 22:28:32 +01:00
Michael Lutz
e740c24eb7 Codechange: Template DoCommand to automagically reflect the parameters of the command proc.
When finished, this will allow each command handler to take individually
different parameters, obliviating the need for bit-packing.
2021-12-16 22:28:32 +01:00
Michael Lutz
7048e1522f Codechange: Move flags in CommandProc in front of the command arguments. 2021-12-16 22:28:32 +01:00
Michael Lutz
33ca4f2b99 Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
2021-12-16 22:28:32 +01:00
Michael Lutz
549caca39c Codechange: Move command arguments to the back of the networked command function calls. 2021-12-16 22:28:32 +01:00
Michael Lutz
b6933a2ebd Codechange: Move command arguments to the back of the DoCommand function call. 2021-12-16 22:28:32 +01:00
Jonathan G Rennison
62afd94b47 Merge branch 'master' into jgrpp-beta
# Conflicts:
#	src/company_cmd.cpp
#	src/economy.cpp
#	src/lang/swedish.txt
#	src/network/network_command.cpp
#	src/news_gui.cpp
#	src/saveload/saveload.h
#	src/script/api/script_list.cpp
#	src/video/cocoa/cocoa_v.mm
#	src/video/sdl2_v.cpp
2021-11-01 18:54:43 +00:00
Jonathan G Rennison
61cc60099a Merge branch 'jgrpp' into jgrpp-beta
# Conflicts:
#	src/network/core/packet.cpp
#	src/network/core/udp.cpp
2021-10-29 22:22:54 +01:00
Jonathan G Rennison
28fd549808 Decline company takeover offer on company's behalf if company has no client 2021-10-24 12:23:52 +01:00
Jonathan G Rennison
296987153b Add console command to offer a company for sale 2021-10-24 00:11:51 +01:00
Jonathan G Rennison
ec8512e2ea When declining to buy a company, ask the next company immediately 2021-10-24 00:07:54 +01:00
Jonathan G Rennison
4042480806 Merge branch 'jgrpp' into jgrpp-beta
# Conflicts:
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/table/company_settings.ini
#	src/table/currency_settings.ini
#	src/table/gameopt_settings.ini
#	src/table/misc_settings.ini
#	src/table/settings.h.preamble
#	src/table/settings.ini
#	src/table/win32_settings.ini
#	src/table/window_settings.ini
2021-10-08 18:12:04 +01:00
Jonathan G Rennison
24fdc8331b Add CheckCaches mode to emit a log/save/screenshot on detected issue 2021-10-03 23:57:27 +01:00
Jonathan G Rennison
5ed7aee8d3 Add flags field to CheckCaches for which checks to run
Add header file for CheckCaches
2021-10-03 23:03:39 +01:00
Jonathan G Rennison
fd605e3cf3 Merge branch 'master' into jgrpp-beta
# Conflicts:
#	.github/workflows/commit-checker.yml
#	src/company_cmd.cpp
#	src/console_cmds.cpp
#	src/crashlog.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/indonesian.txt
#	src/lang/japanese.txt
#	src/lang/korean.txt
#	src/lang/swedish.txt
#	src/linkgraph/linkgraphjob.cpp
#	src/linkgraph/mcf.cpp
#	src/network/core/tcp.cpp
#	src/network/core/tcp.h
#	src/network/core/tcp_game.h
#	src/network/core/udp.h
#	src/network/network.cpp
#	src/network/network_admin.cpp
#	src/network/network_admin.h
#	src/network/network_chat_gui.cpp
#	src/network/network_client.cpp
#	src/network/network_client.h
#	src/network/network_func.h
#	src/network/network_internal.h
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/newgrf.cpp
#	src/newgrf_station.cpp
#	src/order_gui.cpp
#	src/rail_cmd.cpp
#	src/saveload/saveload.cpp
#	src/settings.cpp
#	src/settings_gui.cpp
#	src/settings_internal.h
#	src/settings_type.h
#	src/station_cmd.cpp
#	src/stdafx.h
#	src/table/currency_settings.ini
#	src/table/misc_settings.ini
#	src/table/settings.h.preamble
#	src/table/settings.ini
#	src/terraform_cmd.cpp
#	src/timetable_gui.cpp
#	src/train_cmd.cpp
#	src/tree_cmd.cpp
#	src/water_cmd.cpp
2021-09-27 22:47:23 +01:00
rubidium42
9a7750f14e Codechange: use the constructor for CompanyNewsItem to fill the data instead of a separate function 2021-07-01 19:04:38 +02:00
rubidium42
aa9818db90 Codechange: create a type for the "free_data" of NewsItems and (de)allocate it with new and delete 2021-07-01 19:04:38 +02:00
Patric Stout
5b50ae72f8 Fix #9348, 4d74e51: don't try to sell shares of spectators (#9349)
"new_owner" can be INVALID_OWNER, and as INVALID_OWNER ==
COMPANY_SPECTATORS, we could end up trying to sell shares of
nobody.

(cherry picked from commit ef25afd55a)
2021-06-10 23:21:42 +01:00