Age | Commit message (Collapse) | Author |
|
the left list, and only the selected rail type in the right list, to
allow converting electric engines to non-electric.
|
|
_*_vehicle_info[]; create and use a function to retrieve data, and ensure constness.
|
|
code and proofreading, thanks to peter1138 for another lot of code and ideas.
|
|
function call for drawing of vehicles.
|
|
|
|
|
|
Reduce variable scope, remove write-only variables, turn do-while-loops with multiple induction variables into canonical for-loops
|
|
|
|
- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
|
|
shuffling order of rail vehicle purchase list (and replace vehicle list)
|
|
currently ALL available wagons are displayed in the right menu in the replace window
however the replacement will only be done if the new wagon can be refitted to carry same cargo as the old one is currently carrying
Since the standard vehicles do not have any valid wagon replacements, this feature can only be used when using newgrf sets
|
|
(based on meush's work)
|
|
newgrf_engine.[ch], and add the new files to project files.
|
|
|
|
- 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)
|
|
|
|
redraw the replace window after the command has completed, rather than after calling the command.
|
|
trains: Use the length of the train before the replacement as reference length
|
|
|
|
has a replacement set up; this stops loops being set up.
|
|
INVALID_ENGINE, as appropriate.
|
|
their actual use, and add "Close Window" tooltip where missing.
|
|
replacement code.
|
|
This means that any user attempt to remove a rear engine will tell the user to move the front engine instead
This fixes the assert when moving multiheaded engines (introduced in r3144)
Note: to make old savegames use this feature, some engines might be turned around in order to link engines in pairs
-Codechange: train subtype is now a bitmask
This allows fast access to info like if it is a wagon or engine and if it is in front and so on
Note: savegame version bump
|
|
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
|
|
|
|
long trains
-Trains will now remember the length of stations it visits and sell cars
when being autoreplaced if they became too long
-If it needs to remove cars, then it starts from the front and sells
all it can find until the train is short enough
-This only works for trains, that knows the station length of the route
so a full uninterrupted run is needed
-a train needs 1-2 runs to detect if the shortest station is expanded
-This feature can be turned on and off in the train replace window
and each company can have it's own setting
-NOTE: minor savegame version bump
|
|
by cargo classes.
|
|
window after all player's vehicles of that type have been replaced. This allows the replacement to be removed. These vehicles are shown in grey instead of the player's colour.
|
|
vehicle gui, and add brief commenting.
|
|
|
|
this is a complete rewrite, that makes use of existing commands like build and sell
this means that multiheaded train engines are replaced correctly
|
|
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
|
|
of manual shifting/anding
|
|
|
|
|
|
plus some related changes (mostly casts)
|
|
and -1
|
|
|
|
correct item when some items were hidden.
-Separate disabled and hidden masks in drop downs to support both hidden and disabled items.
|
|
functions that don't change their pointer parameters
- change a lot of byte player types to PlayerID
- beautify header files, same "#endif /* filename */" ending
|
|
clean up, and make window-title a bit more meaningful (specify vehicle type replaced)
|
|
|
|
serverside
-This means that one company can only have one setting for renew and replacing
more clients will not fight due to different settings anymore
-This is a needed step in the line to fix autoreplacing dualheaded locomotives
NOTE: savegame revision bump (peter1138 + me in coop)
|
|
|
|
GetPlayer(_local_player)->avail_railtypes - this removes the need for updating this code if we add more railtypes and it also allows the menu to show maglev when monorail is not available
|
|
|
|
|
|
|
|
|