Age | Commit message (Collapse) | Author |
|
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)
|
|
|
|
when cloning refitted trains (chrishuebsch)
|
|
-This allows a player to clone an excisting vehicle of his own
-[fix]: this uncovered an excisting bug in CmdBuildRailVehicle() where depots could build trains of the wrong track type. This is fixed
-Thanks to Celestar for drawing the sprites and _luca_ for including them in openttd.grf
|
|
|
|
|
|
|
|
of GB - should be a bit nicer to read
|
|
|
|
explicitly. Prevents trains from unreserving eachothers paths in some cases.
- CodeChange: Use the TrackdirToTrack function instead of &7, and remove an unneeded variable.
|
|
the calls evenly over the day.
|
|
structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
|
|
multiple trains within the same signal block, provided their paths dont intersect. For this the block must have all exit and entry signals be pbs signals. Place these by ctrl-clicking 4 times on a normal signal.
- Feature: [pbs] Implement autoplacement of pbs blocks, when a block has an entry and an exit pbs signal, covert the entire block to pbs. Can be turned off in the patch settings.
- Feature: [pbs] Allow showing of reserved status by making the tracks darker, when the pbs debug level is at least 1.
|
|
funciton IsCompatibleRail().
- Codechange: [NPF] Check the railtype along a route against the engine type instead of against the previouse tile. This clears the way for electriefied rails.
- Add: [NPF] [ 1209644 ] A penalty for crossings (peter1138)
|
|
committing, restore the sort order in the Makefile
|
|
TileVirtXY
|
|
|
|
|
|
|
|
calls to the associated wrapper functions.
* Codechange: Made npf.c use some map array accessing wrappers instead of direct access.
* Codechange/Fix: Named every enum in tile.h. Fixes a nasty bug on MSVC where arrays would be initialised with zeroes (tnx Asterix_)
* Removed magic numbers from tables in tile.c.
* Added some explicit casts in tile.h.
|
|
* Add: rail.[ch] for rail-related enums and wrapper functions.
* Codechange: Removed dozens of magic numbers with below enums.
* Codechange: Rewrote CheckTrackCombination().
* Add: TILE_SIZE, TILE_PIXELS and TILE_HEIGHT constants.
* Add: enums RailTileType, RailTileSubtype, SignalType to mask against the map arrays.
* Add: enums Track, TrackBits, Trackdir, TrackdirBits for railway track data. (Note that the old RAIL_BIT constants are replaced by TRACK_BIT ones).
* Add: enums Direction and DiagDirection
* Codechange: Moved a bunch of track(dir) related lookup arrays from npf.[ch] to rail.[ch].
* Codechange: move RailType enum from tile.h to rail.h.
* Add: Wrapper functions for masking signal status in the map arrays: SignalAlongTrackdir, SignalAgainstTrackdir and SignalOnTrack.
* Add: Wrapper functions to access rail tiles, using above enums
* Add: Wrapper functions to modify tracks, trackdirs, directions, etc.
* Add: Wrapper functions for all lookup arrays in rail.[ch] (Arrays are still used in parts of the code)
* Codechange: Renamed some variables and arguments to better represent what they contain (railbit -> track, bits -> trackdirbits, etc.).
* Codechange: Don't use FindLandscapeHeight() in CmdRemoveSingleRail(), since it returns way too much info. Use GetTileSlope() instead.
* Codechange: [NPF] Removed some unused globals and code from npf.c.
|
|
|
|
and the callback that goes with it.
- Codechange: Remove some magic numbers (PALETTE_CRASH)
|
|
of calculating it all over the place.
- Fix: Also recalculate the train cache values for 'wagon chains' (in the depot without an engine), to avoid possible desyncs later.
- Fix: Make CmdMoveRailVehicle update the caches of the correct trains in all cases.
|
|
power/weight/max speed instead of recalculating it each time.
- Fix: Station ratings now depends on the max speed of a consist, without being affected by other speed limits from realistic acceleration.
|
|
|
|
removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big.
- Fix: also fix an unnoticed error in SlSaveLoadConv() due to wrong types.
|
|
support it. Only valid ones are signs (delete) and waypoints (rename to default).
|
|
of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
|
|
extensive rewrite and global/local-cargo ID juggling and bitmasking. However with this done it looks better as well and is compatible with newgrf handling. Big thanks to HackyKid for doing most of the work. This also closes patch "[ 1199277 ] Command checks"
|
|
refit ones remain, and some server-only commands.
- CodeChange: remove cmd-misuses CmdStartScenario() and CmdDestroyCompanyHQ()
- Fix (invisible): when parameter checking CmdRestoreOrderIndex() the vehicle did not have its orders yet, so it would fail. So move doing this until AFTER the orders have been added back in RestoreVehicleOrders()
|
|
- CodeChange: since only the server will be able to modify difficulty settings, leave the checking of correct values besides, and trust users will join legit servers.
- CodeChange: for renaming signs, only check if GetDParam(); eg _decode_parameters is empty ('\0') or not, instead of the extra check of players, etc. That basically does the same thing. Also dirty sign two times when renaming, once before, once after the action. Because if the name becomes shorter and you update only after, garbage remains on the screen.
- CodeChange: made GetMaskOfTownActions() available to the town-cmd to double-check if the action was available to the player. For this purpose the hardcoded _local_player has been removed from the function and is now passed as a parameter.
|
|
to a total of 61, which is 53% :)
- CodeChange: To correctly accept engine-prototypes, the best-player checking has been moved to its own function, I hope it functions the same as before.
- CodeChange: Added symbolic types of PlayerID, OrderID and EngineID. For engines also added GetEngine() and IsEngineIndex(), similar to the other such functions.
- CodeChange: To correctly build industries, some tables have been moved to build_industry.h. The only way to find out currently if an industry is valid in a climate is by looping all industries and checking if it matches. Also to comply with the patch setting build_rawmaterial_industries, it is assumed that these industries do not accept any cargo of any type. This can and probably should changed in the future to some flag in their struct. Also use _opt_ptr instead of _opt.
- CodeChange: implemented the HQ checking code inspired by MarkR2 in "[ 1190944 ] Many commands not checked for security". Unfortunately it is impossible to prevent only deleting a HQ by a modified client atm.
- CodeChange: For insert order and modify order their parameters are implicitely truncated to 8 bits, instead of the 16 bits said in the comments.
|
|
with INVALID_VEHICLE, vehicle index is of type VehicleID
|