summaryrefslogtreecommitdiff
path: root/train_cmd.c
AgeCommit message (Collapse)Author
2005-11-14(svn r3179) - RandomRange() and RandomTile() instead of home brewed versionstron
- CHANCE*() instead of mumbling strange numbers
2005-11-14(svn r3177) GB, CLRBIT, HASBIT, TOGGLEBITtron
2005-11-13(svn r3176) Use proper types, not some variants of inttron
2005-11-13(svn r3172) static, consttron
2005-11-08(svn r3156) -Fix: removed some cases where autoreplace windows were redrawn ↵bjarni
when nothing was changed due to the FOR_ALL_VEHICLES(), redrawing those windows are slow
2005-11-07(svn r3155) -Feature: [autoreplace] autoreplace can now remove cars from too ↵bjarni
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
2005-11-07(svn r3150) Unify some code duplication in HandleLocomotiveSmokeCloud()peter1138
2005-11-06(svn r3147) Fix crash when building dual-head rail vehicles...peter1138
2005-11-06(svn r3146) Avoid use of variable size declared arrays when allocating ↵peter1138
articulated rail vehicles.
2005-11-06(svn r3145) Fix two off-by-one errors in building articulated rail vehicles.peter1138
2005-11-06(svn r3144) -Fix: a new train is now made if the front unit is an engine and ↵bjarni
the former front engine is moved away (Meush)
2005-11-05(svn r3139) -NewGRF, Feature: support for articulated rail vehicles. This is ↵peter1138
used, for example, by coal tenders.
2005-11-04(svn r3136) -Fix: [autoreplace] all cargo in engines that consists of more ↵bjarni
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
2005-11-04(svn r3132) -NewGRF: support positioning of rail vehicle visual effects.peter1138
2005-11-03(svn r3124) Alter train loading/unloading time to use the actual length of ↵peter1138
the train instead of the number of wagons. The actual length is cached in the first vehicle of the train.
2005-10-31(svn r3111) -Fix: [autoreplace] [ 1341783 ] Assertion failure in vehicle.c ↵bjarni
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)
2005-10-30(svn r3107) -NewGRF: Move train y-position offset adjustment to remove code ↵peter1138
duplication, and make it apply only to vehicles with a custom image.
2005-10-29(svn r3101) -Codechange: added _new_vehicle_idbjarni
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()
2005-10-28(svn r3098) static, const, uint -> TileIndex, indentation, bracing, unused ↵tron
return values, ... mostly related to the clone vehicle GUI
2005-10-24(svn r3081) -Codechange: [autoreplace] complete rewrite of autoreplacebjarni
this is a complete rewrite, that makes use of existing commands like build and sell this means that multiheaded train engines are replaced correctly
2005-10-23(svn r3078) Some more stuff, which piled up:tron
- 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
2005-10-18(svn r3058) The default AI may not build dual headed trains under certain ↵tron
circumstances. Simplify this check by testing the rail vehicle info flags instead of passing a global variable around. Note: This is not exactly the original behaviour, because the Lev4 was always allowed to be built, but i guess that was a glitch.
2005-10-16(svn r3052) Fix last commit *grml*tron
2005-10-16(svn r3051) Remove the unused function RemoteSubsidyAdd()tron
2005-10-16(svn r3048) Replace 0/1/2 by RAILTYPE_RAIL/MONO/MAGLEV where appropriatetron
2005-10-13(svn r3036) Use IsCompatibleRail() to check the rail type of level crossings ↵tron
(not a fix, because the old == method works so far)
2005-10-05(svn r3019) -Codechange: Replace explicit shifting/anding/oring with GB and SBtron
2005-10-03(svn r3010) Get rid of quite some dubious casts, either by using GB(), ↵tron
proper types or just removing them
2005-10-02(svn r3008) [ 1247535 ] Native Support for Win64 (compile&run only) (michi_cc)Darkvater
Fix warning in graph_gui.c with const problem
2005-10-01(svn r3003) Change int, uint, uin16 and byte to EngineID where appropriate, ↵tron
plus some related changes (mostly casts)
2005-09-30(svn r3001) s/Player*/const Player*/tron
s/byte/PlayerID/ s/int/PlayerID/ and related changes
2005-09-26(svn r2990) Remove _engine_original_sprites and replace all uses with ↵peter1138
references to our (new) original engine/vehicle tables.
2005-09-26(svn r2989) - Make engine/vehicle information tables constant. Duplicate ↵peter1138
them so NewGRF data can be loaded without wiping out the default data.
2005-09-24(svn r2982) Newgrf: Added patch option for wagon speed limits. This is ↵peter1138
enabled by default.
2005-09-23(svn r2977) - CodeChange: [pbs] Use a check to see if a rail segment is a ↵hackykid
pbs segment, instead of letting the pathfinder determine this.
2005-09-20(svn r2967) Fix: newgrf: Wagon speed limits don't apply for wagons with ↵peter1138
livery overrides. Fixes max speed in dbsetxl etc.
2005-09-18(svn r2962) - const correctness for all Get* functions and most Draw* ↵Darkvater
functions that don't change their pointer parameters - change a lot of byte player types to PlayerID - beautify header files, same "#endif /* filename */" ending
2005-09-14(svn r2951) - Fix: [ 1259345 ] Changing engine in netgame opens train window ↵Darkvater
for everyone - Add IsLocalPlayer() which substitutes _local_player == _current_player
2005-08-23(svn r2886) Rename the "owner" attribute to "m1", because when it stores an ↵tron
owner it is accessed by [GS]etOwner anyway and when it doesn't store an owner, but arbitrary data, accessing a field called "owner" is confusing.
2005-08-01(svn r2781) Fix some of the issues with variables in .h files.ludde
2005-07-31(svn r2764) -Feature: Clone vehiclesbjarni
-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
2005-07-28(svn r2732) -Codechange: Cleaned the order flags some more. Hit some ↵celestar
inconsistencies while trying to locate bug 1244167
2005-07-24(svn r2701) Insert Id tags into all source filestron
2005-07-23(svn r2696) Remove stray semicolonstron
2005-07-22(svn r2674) - CodeChange: [pbs] Generalise the PSBISPbsDepot function so it ↵hackykid
can check if an arbitrary junction is a pbs junction. Preparations for making pbs more safe.
2005-07-22(svn r2673) Include functions.h directly, not globally via openttd.htron
2005-07-21(svn r2660) Get rid of some more shifting/anding/castingtron
2005-07-20(svn r2650) Convert many explicit shifts+ands to extract bits to invocations ↵tron
of GB - should be a bit nicer to read
2005-07-19(svn r2645) Fix (useless)warning in graph_gui and add brackets around HASBIT ↵Darkvater
in an if statement
2005-07-19(svn r2635) Fix: [ntp/misc] Improve the old pathfinder. Changed it to A* ↵ludde
instead of Dijkstra. - Benchmark shows that NTP is now around 10x faster than NPF. - Made IsTunnelTile macro to determine if a tile is a tunnel. - Added some useful debugging functions for making tiles red / getting accurate timestamps. - Remove old depot finding algorithm. - Disable warning for signed/unsigned comparisons.