Commit Graph

127 Commits (896551850ab104e6ef976f2d5d48056a3e05aebf)

Author SHA1 Message Date
tron c8dd64bdbc (svn r3489) Remove an unused declaration 19 years ago
Darkvater 4e09974975 (svn r3472) - [PBS] Remove from trunk. Anyone interested can still find it in branch/pbs. This reverts revisions r3158, r3140, r3075, r2977, r2674, r2625, r2621, r2529, r2528, r2525, r2524, r2519, r2517, r2516, r2507, r2499. (in conjunction with Tron)
- The only change is that the nsignalsw.grf file is kept and that existing nightlies with PBS signals get those signals converted to combo-signals.
19 years ago
bjarni b87b5f1187 (svn r3402) -Fix: [building/cloning] added a string telling if build failed due to not being able to build a vehicle. Triggered when cloning a retired design 19 years ago
truelight b23ffe4045 (svn r3371) -Fix: don't allow road-vehicles to perform an out-of-bound operation while overtaking in a curve (tnx to guru3, Tron and peter1138)
-Codechange: while at that, removed a local variable (more pretty :))
19 years ago
tron af70b49bf7 (svn r3367) Unify the 4 distinct CMD_CHANGE_{AIRCRAFT,ROADVEH,SHIP,TRAIN}_SERVICE_INT commands into one CMD_CHANGE_SERVICE_INT command.
As side effect this is a
-Fix: The default AI tried to change the service intervals of vehicles via the CMD_CHANGE_TRAIN_SERVICE_INT command - regardless of the type of the vehicle - which of course failed for non-trains
19 years ago
tron e272b03fee (svn r3365) Staticise 36 functions 19 years ago
tron 5353d05865 (svn r3358) Remove another piece of unused code 19 years ago
peter1138 1ffc700797 (svn r3352) - NewGRF: Move initialization of vehicle random_bits to DC_EXEC blocks to allow use of Random() instead of InteractiveRandom(), which will alleviate some possible network desyncs. 19 years ago
tron b06b3e2ca2 (svn r3313) Remove GPMI related changes from trunk
Revisions in detail: 2542, 3226 (partial), 3229, 3231, 3232, 3238, 3242-3245, 3251, 3253, 3260, 3263, 3265, 3266, 3269, 3277, 3278, 3279, 3283 (partial), 3304, 3305, 3306
19 years ago
truelight 531073bea0 (svn r3305) -Rename: Changed all instances of ottd_ related to the AI to ttai_ 19 years ago
tron bf98086de8 (svn r3298) Remove unused and write-only variables 19 years ago
truelight 8733f49e88 (svn r3232) -Add: implemented the event-system for AIs
-Add: added several hooks (event-callbacks) for road-related-stuff
19 years ago
peter1138 3e702afc08 (svn r3213) - Codechange: Clean up handling of road stops, avoiding unnecessary use of pointers and using the *BIT() macros. 19 years ago
tron 8cebe2f607 (svn r3204) Make handling of clicking on vehicles a bit less ugly by avoiding function declarations in .c files and unnecessary indirection 19 years ago
tron 5fa6b7eb06 (svn r3179) - RandomRange() and RandomTile() instead of home brewed versions
- CHANCE*() instead of mumbling strange numbers
19 years ago
tron ee15e3de13 (svn r3172) static, const 19 years ago
bjarni 5e278b7ec3 (svn r3156) -Fix: removed some cases where autoreplace windows were redrawn when nothing was changed
due to the FOR_ALL_VEHICLES(), redrawing those windows are slow
19 years ago
bjarni 682b9ee8e4 (svn r3111) -Fix: [autoreplace] [ 1341783 ] Assertion failure in vehicle.c 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)
19 years ago
bjarni 6d41c23cf2 (svn r3101) -Codechange: added _new_vehicle_id
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()
19 years ago
bjarni bf467bd99c (svn r3081) -Codechange: [autoreplace] complete rewrite of autoreplace
this is a complete rewrite, that makes use of existing commands like build and sell
        this means that multiheaded train engines are replaced correctly
19 years ago
tron f5ea31b9da (svn r3079) Determine the type of the "first arrival" message for road vehicles using the cargo type and not a magic engine number 19 years ago
tron 47137cefb7 (svn r3078) Some more stuff, which piled up:
- 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
19 years ago
tron ae4a1f3675 (svn r3019) -Codechange: Replace explicit shifting/anding/oring with GB and SB 19 years ago
tron db3b1228bf (svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them 19 years ago
tron 0cc45ecd8e (svn r3003) Change int, uint, uin16 and byte to EngineID where appropriate, plus some related changes (mostly casts) 19 years ago
peter1138 fbf06041ca (svn r2990) Remove _engine_original_sprites and replace all uses with references to our (new) original engine/vehicle tables. 19 years ago
tron 91353c841f (svn r2780) Remove some more unused strings and make the use of a few strings more explicit 19 years ago
celestar 21ed40bc53 (svn r2732) -Codechange: Cleaned the order flags some more. Hit some inconsistencies while trying to locate bug 1244167 19 years ago
tron a227065ab7 (svn r2701) Insert Id tags into all source files 19 years ago
tron 559babcdc9 (svn r2673) Include functions.h directly, not globally via openttd.h 19 years ago
tron d71788c402 (svn r2660) Get rid of some more shifting/anding/casting 19 years ago
Darkvater ff2662ebe7 (svn r2617) - Fix: fix some warnings, and reenable vs.net2003 signed/unsigned warnings 19 years ago
ludde 2fd162b8dd (svn r2604) Fix: removed unused variable 19 years ago
ludde 62011eed95 (svn r2603) Fix [multistop] Fix problem with multistop handling, the range in my fix was way too high. Also only lock a slot for 5 days instead of 30. 19 years ago
ludde 718307ffa4 (svn r2599) Fix: Road vehicle multistop handling used NPF even if NPF was off????
- Also simplified/optimized the code.
 - Now it uses manhattan distance as an approximation instead of actual distance to find the distance. Much faster.
19 years ago
tron 8c1d74162f (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes. 19 years ago
hackykid 60ddaf95f0 (svn r2516) - Feature: [pbs] Implement path-based-signalling. This allows 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.
19 years ago
matthijs fb8e5f61b1 (svn r2514) - Codechange: [NPF] Move the checking of railtype into a 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)
19 years ago
tron b64c9b8b1f (svn r2504) Move Draw*EngineInfo to engine_gui.c to reduce dependencies 19 years ago
tron ab7b8b50e3 (svn r2492) Remove some pointless casts and fix some nearby indentation 19 years ago
tron 61f6f07edd (svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY 19 years ago
tron 3154e7148d (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile" 19 years ago
matthijs 9cb58e0bb3 (svn r2448) General cleanup of rail related code, more to follow.
* 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.
19 years ago
celestar 9b8cb17831 (svn r2441) -Feature: You can now give transfer order to set up feeder systems 19 years ago
Darkvater 0171aae109 (svn r2433) - CodeChange: unmagicify all road/train crossings with IsLevelCrossing() function (peter1138) 19 years ago
tron fa8f46c0b7 (svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[] 19 years ago
tron 0c4ecbe9ec (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner 19 years ago
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 19 years ago
Darkvater 921cc4e94a (svn r2297) - CodeChange: server-check the next batch of commands.
- 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.
19 years ago
Darkvater 729066e407 (svn r2294) - CodeChange: check the service interval settings when changing 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. 19 years ago