Darkvater
494c56475f
(svn r6884) -Codechange: Add strict bounds checking in string formatting system.
...
The last parameter should point to the end of the buffer (eg lastof(buf))
Courtesy of Tron.
18 years ago
Darkvater
b70e4cefb3
(svn r6814) -Codechange: For network games ci->client_playas was always p->index + 1. To
...
correctly handle this ci->client_playas - 1 was used all over the code making
it pretty confusing at times. Use proper one-on-one values now. Special handling
is only needed for user-output to not to confuse users.
18 years ago
Darkvater
d4b990a01d
(svn r6803) -Codechange: Substitute magic numbers by an enum for the news windows
18 years ago
Darkvater
f440033c66
(svn r6784) -Codechange: Change invalid PlayerID type into ClientID which it is in CmdPlayerCtrl
18 years ago
Darkvater
89e811b4d7
(svn r6780) -Codechange: Remove GPMI leftovers (-b impersonisation of AI in MP).
18 years ago
Darkvater
4c9d9a87f1
(svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an
...
actual playable player (< MAX_PLAYERS) or not.
18 years ago
Darkvater
2380bb56cd
(svn r6775) -Codechange: Use some more proper types, especially Owner and PlayerID as
...
these are used intermixed often.
18 years ago
Darkvater
a85d679f54
(svn r6774) -Codechange: Rename the badly named OWNER_SPECTATOR to PLAYER_SPECTATOR and
...
put it into player.h where it belongs (instead of map.h)
18 years ago
Darkvater
68c0320be6
(svn r6771) -Codechange: Replace two macros with functions. IS_HUMAN_PLAYER and
...
IS_INTERACTIVE_PLAYER
18 years ago
Darkvater
40365cc292
(svn r6748) -Codechange: Use already existing function to count active players.
18 years ago
peter1138
2df539e30d
(svn r6544) - Codechange: Rename CmdReplaceVehicle to CmdSetAutoReplace, to reflect what it does.
18 years ago
Darkvater
552570f9e6
(svn r6462) -Codechange: Have GetStringWidth() return width as well as the height bounding
...
box of the string. Therefore rename the function to GetStringBoundingRect()
and have it return a BoundingRect type of width/height
18 years ago
peter1138
7f13f4e82f
(svn r6458) - Fix (r6457): ... but close the colour window if the company is removed. (Thanks Rubidium)
18 years ago
peter1138
e47dd91c8b
(svn r6455) - Feature: Add 2cc (two company colours) livery schemes. This replaces the original colour selection window and bumps the saveload version. Liveries are supported for all vehicles, not just those with 2cc support. Thanks to lakie for GUI inspiration.
18 years ago
bjarni
f6719443ad
(svn r6430) -Fix r6424: fixed failure to init the whole array of engines when starting a new player
18 years ago
bjarni
c545edf46f
(svn r6424) -Codechange: [autoreplace] removed a loop though all vehicles from each time the window is redrawn
...
To do this, the player struct contains an array, that contains the count of each engine type that the player owns
Those arrays are updated each time a vehicle is build or deleted and is calculated on load (it's not saved)
It's possible to access the arrays outside of the autoreplace GUI, so feel free to read from them in other patches as well
18 years ago
rubidium
21ac20aeca
(svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
...
-Cleanup: whitespace alignment of a few tables.
18 years ago
tron
dae76ce67e
(svn r6222) Remove struct ColorList, because the names of its attributes are plain confusing
...
All the struct holds is a simple colour gradient, so using a simple array with 8 entries is more clear
Also add the names of colour the gradients as enum
18 years ago
tron
4e36c4a349
(svn r6183) Move GetDrawStringPlayerColor() out of gfx.[ch]
18 years ago
rubidium
908d3bcfe6
(svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
18 years ago
rubidium
6fb092aa7a
(svn r5999) -Feature: change the original date format to a 32 bits format based at the year 0.
...
The game date subsystem now allows someone to start in the year 0 and continue
up to the year 5 000 000. However, you currently cannot build anything before
1920 as there is no newgrf support for dates before 1920 or after 2090 yet.
18 years ago
truelight
73cd71db04
(svn r5974) -Codechange: added casts all around the place to make Windows 64bit happy (michi_cc)
18 years ago
rubidium
e87e065e41
(svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
...
-Codechange: store all year related variables that are _not_ stored in a savegame/transported over the network in the same format as _cur_year
18 years ago
rubidium
dc54e608e3
(svn r5915) -Cleanup: some variables were named *_date while they were only holding years; rename these variables to match this.
18 years ago
rubidium
9fc837ad85
(svn r5887) -Cleanup: move date related functions, defines and variables to date.[ch]
...
-Cleanup: fix whitespace related coding style issues in date.[ch]
-Cleanup: make original comments doxygen compatible and remove/change outdated comments
18 years ago
Darkvater
e6e42cd5f3
(svn r5886) -Fix [FS#273]: Incomplete removal of player owned property due to lack of money.
18 years ago
tron
772fbda3e3
(svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular
18 years ago
tron
44829a401c
(svn r5262) Add symbolic names for the aircraft subtypes. not perfect, but better than raw numbers
18 years ago
tron
a2362674e3
(svn r5210) Many small changes which piled up: const, unsigned, variable scope, CSE for readability, DeMorgan, if cascades -> switch, whitespace, parentheses, bracing, misc.
18 years ago
KUDr
e02bf1db6a
(svn r4915) - Fix: SLE_UINT8 replaced by SLE_BOOL for bool variables (found by Celestar)
19 years ago
tron
35e93e451f
(svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
...
Remove DoCommandByTile(), because now it does the same as DoCommand()
19 years ago
peter1138
eb15688358
(svn r4201) - Codechange: Do for _engine_info[] what we do for _*_vehicle_info[]; create and use a function to retrieve data, and ensure constness.
19 years ago
belugas
de25bed962
(svn r4136) CodeChange : Revert part of r4092 (as spotted by Tron) and clean-up a little further
19 years ago
belugas
ed86c3d818
(svn r4092) CodeChange : Named sprites instead of magic numbers plus create/use helper macro/enum for recoloring scheme
19 years ago
Darkvater
650b1b0c93
(svn r3895) - Add proper SLE(G)_CONDNULL macros for the empty space reservation in savegames and update where used
...
- Also add this capability to settings
19 years ago
Darkvater
bf27f0c77b
(svn r3627) - Change all hardcoded 255 max-saveload versions with the define SL_MAX_VERSION
19 years ago
Darkvater
db01f5b852
(svn r3568) - Fix: constantizing side-effect of qsort in r3563. Ugly? Yes. Makes MSVC happy? Yes.
19 years ago
peter1138
abcde6bd9c
(svn r3565) - Fix: On loading a game, GetPlayerRailtypes() didn't account for the fact that vehicles are introduced a year after their introduction date. This will also relieve possible (rare) network desyncs.
19 years ago
tron
75a70e1def
(svn r3563) Simplify the code for calculating the highscore table in network games and saving of old ecenomy data
19 years ago
tron
286876b9d7
(svn r3562) Remove pointless buffer copies
19 years ago
tron
1c3e8630fe
(svn r3511) More whitespace ([FS#46] by Rubidium)
19 years ago
Darkvater
5502f3bf3d
(svn r3500) - Workaround the inaccurate count of spectators/companies that can happen in certain border-cases. For now just dynamically get this value when requested so it is always right. To do properly all player/client creation/destruction needs a hook for networking.
19 years ago
peter1138
bd8f108703
(svn r3468) - Fix: Rail type availability should take climate type into account.
19 years ago
Darkvater
082aa38f79
(svn r3427) - Feature: Allow seeing and setting the maximum amount of companies and spectators for a server. This can be changed/viewed during runtime as well in the console.
19 years ago
peter1138
2222907a40
(svn r3396) - Autoreplace changes:
...
- Change fixed array per player to a single pool. This avoids future problems
with vehicle numbers and decreases savegame size. Engine replacements from
previous savegames will be lost.
- Move engine replacement code from players.c to engine.c.
(thanks to blathijs for rewriting this)
19 years ago
tron
318fe153eb
(svn r3365) Staticise 36 functions
19 years ago
peter1138
d5ce50a405
(svn r3359) - Autoreplace GUI: When starting or stopping a replacement, redraw the replace window after the command has completed, rather than after calling the command.
19 years ago
peter1138
0975885240
(svn r3343) Fix calculation of available rail types where all engines of a particular type are obsolete.
19 years ago
tron
28b8b7e269
(svn r3300) Remove unreachable code - in this case some duplicate breaks
19 years ago
peter1138
14064b223d
(svn r3239) - Codechange: Introduce and use helper functions for engine replacement code.
19 years ago