summaryrefslogtreecommitdiff
path: root/roadveh_cmd.c
AgeCommit message (Collapse)Author
2005-11-23(svn r3232) -Add: implemented the event-system for AIstruelight
-Add: added several hooks (event-callbacks) for road-related-stuff
2005-11-17(svn r3213) - Codechange: Clean up handling of road stops, avoiding ↵peter1138
unnecessary use of pointers and using the *BIT() macros.
2005-11-16(svn r3204) Make handling of clicking on vehicles a bit less ugly by ↵tron
avoiding function declarations in .c files and unnecessary indirection
2005-11-14(svn r3179) - RandomRange() and RandomTile() instead of home brewed versionstron
- CHANCE*() instead of mumbling strange numbers
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-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-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-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 r3079) Determine the type of the "first arrival" message for road ↵tron
vehicles using the cargo type and not a magic engine number
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-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-01(svn r3003) Change int, uint, uin16 and byte to EngineID where appropriate, ↵tron
plus some related changes (mostly casts)
2005-09-26(svn r2990) Remove _engine_original_sprites and replace all uses with ↵peter1138
references to our (new) original engine/vehicle tables.
2005-08-01(svn r2780) Remove some more unused strings and make the use of a few ↵tron
strings more explicit
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-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-17(svn r2617) - Fix: fix some warnings, and reenable vs.net2003 ↵Darkvater
signed/unsigned warnings
2005-07-17(svn r2604) Fix: removed unused variableludde
2005-07-17(svn r2603) Fix [multistop] Fix problem with multistop handling, the range ↵ludde
in my fix was way too high. Also only lock a slot for 5 days instead of 30.
2005-07-17(svn r2599) Fix: Road vehicle multistop handling used NPF even if NPF was ↵ludde
off???? - Also simplified/optimized the code. - Now it uses manhattan distance as an approximation instead of actual distance to find the distance. Much faster.
2005-07-13(svn r2558) Change the internal map format from 7 arrays to one array of ↵tron
structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
2005-07-04(svn r2516) - Feature: [pbs] Implement path-based-signalling. This allows ↵hackykid
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.
2005-07-03(svn r2514) - Codechange: [NPF] Move the checking of railtype into a ↵matthijs
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)
2005-07-01(svn r2504) Move Draw*EngineInfo to engine_gui.c to reduce dependenciestron
2005-06-27(svn r2492) Remove some pointless casts and fix some nearby indentationtron
2005-06-25(svn r2486) Turn TILE_FROM_XY into an inline function and rename it to ↵tron
TileVirtXY
2005-06-24(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"tron
2005-06-16(svn r2448) General cleanup of rail related code, more to follow.matthijs
* 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.
2005-06-15(svn r2441) -Feature: You can now give transfer order to set up feeder systemscelestar
2005-06-07(svn r2433) - CodeChange: unmagicify all road/train crossings with ↵Darkvater
IsLevelCrossing() function (peter1138)
2005-06-07(svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[]tron
2005-06-04(svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix ↵tron
some bogus reads of _map_owner
2005-06-02(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.Darkvater
2005-05-12(svn r2297) - CodeChange: server-check the next batch of commands.Darkvater
- 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.
2005-05-11(svn r2294) - CodeChange: check the service interval settings when changing ↵Darkvater
of all vehicle-types. To simplify things introduce GetServiceIntervalClamped() that returns the same or clamped value of the new service interval. There were some inconsistencies in the gui files so I had to change those, and const correctness kicked in, so it's a bit messy at certain points.
2005-05-06(svn r2273) -Fix: Road vehicles no longer try to obtain a slot when they ↵celestar
have crashed. (peter1138)
2005-05-03(svn r2262) - Fix: Assertion when vehicle in a depot wants to do pathfinding.matthijs
GetVehicleTrackdir now tries to get a valid trackdir as much as possibly, by assuming that a vehicle is facing outwards in a depot or road station, for example. - Codechange: [Multistop] Multistop now also tries to find a slot for road vehicles that are in stations, since the pathfinder now properly handles that.
2005-05-03(svn r2261) - Fix: When crashed vehicles try to find a depot for servicing, ↵matthijs
openttd asserts. Crashed vehicles shouldn't find depots anyway...
2005-05-02(svn r2256) - Fix: Trains cannot find a depot when they are in a tunnel. (glx)matthijs
- Add: GetVehicleTrackdir() helper function. - Codechange: Moved SortStruct from vehicle_gui.h to ttd.h, so the dependency from vehicle.h on vehicle_gui.h could be removed. - Codechange: Typedeffed the VehicleTypes struct so it can be used as the type for Vehicle.type instead of "byte". - Codechange: Removed prototype for VehicleSorter(), which had no implementation anymore and was never called.
2005-05-02(svn r2249) - Fix: [ 1187703 ] [NPF] Road vehicles cannot find a depot when ↵matthijs
in a roadstop
2005-04-18(svn r2213) -Fix/Feature/Codechange: [ Multistop ] Changed the algo so that ↵celestar
it uses NPF. This fixes the problem of RVs attempting to go to unreachable stops [ 1161610 ], and should greatly reduce the wrong stop problem. Cleaned parts of the code
2005-04-15(svn r2202) - Fix: [NPF] When a vehicle could not reach its target, it would ↵matthijs
choose a random direction. It will now try to get as close as possible.
2005-04-11(svn r2184) - CodeChange: remove the copy of ClearSlot(), which is now also ↵Darkvater
called for CmdSkipOrder(). This also fixes the involuntary crash introduced 2 revisions ago
2005-04-08(svn r2169) -Fix: Doing the slot clearing also for crashed road vehicles ↵celestar
(c.f. previous commit)
2005-04-08(svn r2168) - Fix: Various stages of invisible trains, and wrong ↵Darkvater
v->u.rail.track combinations. When a vehicle was sold its (possibly) assigned road slot for multislot was not cleared, thus resulting in a bug confusion. This should fix [ 1178520 ] Assertion failure in ai.c (invalid v->u.rail.track). With big thanks to TrueLight for the demo-recording patch, BJH for the wonderful savegame, Hackykid for his brilliant suggestions of the problem and Celestar for... ehm, making it all possible ;p
2005-03-20(svn r2034) -Codechange: Replaced the rather meaningless LOAD and UNLOAD ↵celestar
flags for depots by something more meaningful