Age | Commit message (Collapse) | Author |
|
starting removal process.
|
|
trains: Use the length of the train before the replacement as reference length
|
|
blocks to allow use of Random() instead of InteractiveRandom(), which will alleviate some possible network desyncs.
|
|
|
|
|
|
|
|
it to the new vehicle. Fixes "[ 1370039 ] Autoreplaced vehicles lose their names"
|
|
engine type directly instead of getting it from a vehicle. This allows the function to be used before vehicles are involved.
|
|
replacement code.
|
|
'major' version to just: version.
|
|
without any cars (introduced in r3220)
|
|
to the train instead of just the new engine
This applies to wagon removal during autoreplace too
|
|
command to make half multiheaded engines
|
|
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
|
|
GetRearEngine(), because it's the engine type of the vehicle which gets passed as first parameter
|
|
|
|
-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
|
|
|
|
Also align short cases nicely
|
|
|
|
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.
|
|
This increases the speed greatly when allocating more than one at a time
(planes, artic engines, cloning...) and when adding another block of
vehicles to the vehicle pool (adding 512 vehicles each time)
|
|
used, for example, by coal tenders.
|
|
allocate some vehicles to clone a train, but not for all cars
Now it gives "too many vehicles" error message instead
To make this work, AllocateVehicles() needed to be moved to vehicle.c (from aircraft_cmd.c) and made non-static
|
|
vehicle entered a depot even though the goto depot was canceled
this assert could be reached by clicking on the goto depot button to cancel goto depot from the orders and the vehicle
still entered the depot. The flags in that case would not be "normal" anymore. An additional check is added to prevent this
|
|
than one vehicle will try to move cargo from all vehicles
currently this applies to planes and multiheaded train engines (no more lost airmail)
added GetNextEnginePart() that returns the next vehicle in an engine nomatter what type it is
when more types of multivehicle engines are added, they will have to be added here too or autoreplace will not remove all cargo
|
|
autoreplacing and could end up with negative money
this is not the same bug as in rev 3128, which means you actually paid 3 times. Now it pays correctly
|
|
autoreplacing and could end up with negative money
|
|
to stop when autoreplacing
this would result in the construction of a new vehicle while the old one just continued
added an assert to make sure it's always stopped before trying to sell the old vehicle
|
|
a plane could lock up an airport
this will not fix already locked up airports
this bug was introduced in rev 3111
|
|
(request by Darkvater)
|
|
line 378
running MaybeReplaceVehicle() is now delayed until after the loop in CallVehicleTicks()
This avoids selling the vehicle the loop currently works with (and continues to work with afterwards)
|
|
this var works like _new_train_id and the rest of that kind of vars, except it is set each time a vehicle is build, nomatter what type
this is a nice tool to code vehicle independent code, which in turn can reduce code duplication
Right now it's used in ReplaceVehicle() and CmdCloneVehicle()
|
|
removed duplicated code and added DoCommand, which used the define build commands added with autoreplace
This should not affect gameplay at all
|
|
showed up in some cases when no replace was needed
|
|
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
|
|
int/uint/int16/byte/-1 with proper types and constants
|
|
CT_INVALID/OWNER_SPECTATOR/INVALID_STATION where appropriate
|
|
introduced in r2991.
|
|
saved prior to r2868 to load.
|
|
functions that don't change their pointer parameters
- change a lot of byte player types to PlayerID
- beautify header files, same "#endif /* filename */" ending
|
|
for everyone
- Add IsLocalPlayer() which substitutes _local_player == _current_player
|
|
didn't get all stats updated (peter1138)
|
|
This makes GetSpriteDimension() superflous, because now it's just a thin wrapper around GetSprite() returning only part of the information, therefore remove it too
|
|
autoreplace failed if new engine is cheaper than the old one (peter1138)
|
|
save/load code, static in saveload.c
|
|
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)
|
|
|