Commit Graph

114 Commits

Author SHA1 Message Date
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
rubidium42 2e136285e1 Codechange: move from C-string to std::string for DoCommand 2021-05-29 19:02:18 +02:00
rubidium42 44ca7d9377 Change: Use gender-neutral pronouns 2021-05-15 10:16:48 +02:00
Pavel Stupnikov 4b42ecb0f6
Feature: Add tile parameter for GSCompany.ChangeBankBalance to show text effect if needed (#8573) 2021-01-22 10:28:26 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Patric Stout 62cdadb582 Change: move "give money" from client-list to company window
This is a much better location for this button, as you send
money from one company to another company, not from player
to player.

This is based on work done by JGRPP in:
f820543391
and surrounding commits, which took the work from estys:
https://www.tt-forums.net/viewtopic.php?p=1183311#p1183311

We did modify it to fix several bugs and clean up the code while
here anyway.

The callback was removed, as it meant a modified client could
prevent anyone from seeing money was transfered. The message
is now generated in the command itself, making that impossible.
2021-01-05 21:56:24 +01:00
glx22 f7e48cac87 Fix #8453: [Script] Don't truncate loan variation to 32bit 2020-12-28 16:51:15 +01:00
Jonathan G Rennison 0c5dc5d41e Change: [Linkgraph] Pause the game when linkgraph jobs lag (#6470)
Check if the job is still running two date fract ticks before it is due
to join, and if so pause the game until its done.
When loading a game, check if the game would block immediately due to
a job which is scheduled to be joined within two date fract ticks,
and if so pause the game until its done.
This avoids the main thread being blocked on a thread join, which appears
to the user as if the game is unresponsive, as the UI does not repaint
and cannot be interacted with.
Show if pause is due to link graph job in status bar, update network
messages.
This does not apply for network clients.
2020-12-22 15:17:57 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
JMcKiern 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
Charles Pigott 327ff89808 Codechange: Remove PauseModeByte 2019-04-29 17:40:22 +01:00
Charles Pigott 5b34c8019f Codechange: Remove Company/OwnerByte types 2019-04-29 17:40:22 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Patric Stout e3c639a09f Remove: ENABLE_NETWORK switch
This switch has been a pain for years. Often disabling broke
compilation, as no developer compiles OpenTTD without, neither do
any of our official binaries.

Additionaly, it has grown so hugely in our codebase, that it
clearly shows that the current solution was a poor one. 350+
instances of "#ifdef ENABLE_NETWORK" were in the code, of which
only ~30 in the networking code itself. The rest were all around
the code to do the right thing, from GUI to NewGRF.

A more proper solution would be to stub all the functions, and
make sure the rest of the code can simply assume network is
available. This was also partially done, and most variables were
correct if networking was disabled. Despite that, often the #ifdefs
were still used.

With the recent removal of DOS, there is also no platform anymore
which we support where networking isn't working out-of-the-box.

All in all, it is time to remove the ENABLE_NETWORK switch. No
replacement is planned, but if you feel we really need this option,
we welcome any Pull Request which implements this in a way that
doesn't crawl through the code like this diff shows we used to.
2019-03-20 19:24:55 +01:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
zuu ab69c6c2a0 (svn r25788) -Feature: [Script] Game Scripts can now charge fees and give money to companies 2013-09-21 13:07:42 +00:00
zuu 01dea4ec37 (svn r25787) -Doc: Doxygen comment was wrong 2013-09-21 10:06:23 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
zuu d219fdb875 (svn r24552) -Fix (r24537): Unpause do no longer continue scripts 2012-09-23 11:30:37 +00:00
truebrain 55de5d336c (svn r23618) -Add: ScriptGame::Pause, ScriptGame::Unpause, and ScriptGame::GetLandscape (GameScript only) 2011-12-19 20:58:59 +00:00
frosch 7bf8b1d96e (svn r22621) -Fix: When asking the user to confirm an unsafe unpausing, there is no need to execute a command if 'no' is choosed. This also prevents crashing when clicking unpause while the confirm window is shown. 2011-07-02 17:40:39 +00:00
rubidium 5286de116b (svn r22028) -Cleanup: remove traces of a debugging "feature" that got disabled a long time ago 2011-02-08 20:47:48 +00:00
rubidium 1d0d7635e0 (svn r22021) -Fix (r22019): ofcourse make doesn't notice files are gone, so it doesn't recompile everything that needs to be recompiled... 2011-02-07 22:49:38 +00:00
frosch ed4f806f1d (svn r20283) -Codechange: Unify start of doygen comments. 2010-08-01 19:22:34 +00:00
frosch 1d3adb2b66 (svn r19931) -Fix (r19914): Convert assertion in Backup<> destructor into DEBUG() output. It was triggered on exceptions, especially when aborting world generation. 2010-06-05 12:16:12 +00:00
frosch 406c2a9865 (svn r19930) -Codechange: Deduplicate magic command parameter casts. (rubidium) 2010-06-05 11:51:34 +00:00
frosch 9db3cde73a (svn r19914) -Codechange: Wrap a helper class around temporary assignments of _current_company to ensure proper restoration. 2010-05-31 20:22:57 +00:00
yexo 879057de25 (svn r19684) -Fix [FS#3779]: don't show an error message when trying to give another client an amount of 0 money 2010-04-20 18:02:08 +00:00
frosch 77486ee8d2 (svn r19658) -Fix: One could turn transport companies into credit banks. 2010-04-17 14:57:49 +00:00
yexo 8165737939 (svn r19544) -Feature [FS#3496]: add an input box to the AI Debug window where you can input a break string (patch by Zuu) 2010-04-02 17:35:20 +00:00
alberth f05a8635fd (svn r19483) -Codechange: Code layout fixes, and parentheses reduction. 2010-03-20 15:30:57 +00:00
rubidium 74ffe8647f (svn r18732) -Codechange: move the company related commands of misc_cmd.cpp to company_cmd.cpp 2010-01-05 17:11:56 +00:00
rubidium b00a5f1069 (svn r18330) -Cleanup: remove some unneeded includes 2009-11-28 20:35:25 +00:00
rubidium 2a1cab4d46 (svn r18052) -Codechange/Fix: make the 'pause' chat message when actually executing the pause command. This to prevent showing paused and especially unpaused to be shown when the state doesn't change. Output now mentions whether pause changes keep the game paused and what reasons for pausing there 'currently' are. 2009-11-12 20:33:30 +00:00
rubidium 934e6a295d (svn r18051) -Codechange: make the active clients pause use a separate bit in the pause mode 2009-11-12 17:46:04 +00:00
rubidium 3f2dce581e (svn r18050) -Codechange: disallow 'pause on join' paused when not in a network game 2009-11-12 17:44:49 +00:00
rubidium d6cded5380 (svn r17693) -Cleanup: remove some unneeded includes 2009-10-04 17:16:41 +00:00
rubidium 04d5b67eb6 (svn r17567) -Fix: some doxygen warnings 2009-09-18 14:23:58 +00:00
frosch ebd916be3d (svn r17532) -Codechange: Rename several Invalidate functions to SetDirty for more consistency and distinguishability. 2009-09-13 19:15:59 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
rubidium 1fe3ad3288 (svn r17075) -Codechange: rename ~750 strings to be more uniform with their relatives 2009-08-05 17:59:21 +00:00
frosch 9853c0dc22 (svn r16480) -Fix (r15617): Invalidate newgrf variable caches of more vehicles in more places. Esp. they were only invalidated for trains. 2009-05-31 12:03:14 +00:00
rubidium 6237fe1462 (svn r16394) -Codechange: move (NewGRF) cache variables into a separate struct so (some vehicle related) NewGRF cache 'desyncs' can be tested easier. 2009-05-23 09:10:56 +00:00
smatz 871107f529 (svn r16327) -Codechange: replace IsValidPoolItemID(index) by PoolItem::IsValidID(index) 2009-05-17 01:00:56 +00:00
smatz 6221d74644 (svn r16325) -Codechange: replace GetPoolItem(index) by PoolItem::Get(index) 2009-05-16 23:34:14 +00:00
rubidium 2664f2a2d9 (svn r16242) -Codechange: rework pausing
-Fix [FS#2864]: autopause and manual pausing conflict with eachother
-Fix: new game + pause on new game + autopause make the game not unpause on the first join
2009-05-06 15:06:57 +00:00
rubidium 59d45a04d6 (svn r16118) -Change/cleanup: remove the hexadecimal 'in TTD the string had this ID' from 'some' strings and replace the string name with something more sensible. 2009-04-21 23:40:56 +00:00
smatz 40745dc0d9 (svn r15704) -Cleanup: remove further includes from recently split files 2009-03-13 23:48:07 +00:00
rubidium c0d71b84f9 (svn r15617) -Change [FS#2694]: vehicle variables 40-43 weren't cached (though spec stated they are). Caching these variables can yield a 10+% speed increase when those vehicle variables are queried often. 2009-03-04 23:32:23 +00:00