Commit Graph

150 Commits (1be0d9926ea9b865e6556d3dc9ea79227788f364)

Author SHA1 Message Date
peter1138 624bc5404b (svn r4693) - NewGRF: invalidate aircraft in viewports during loading stages so that graphic changes are visible. (mart3p) 18 years ago
peter1138 f443ae960c (svn r4653) - NewGRF: enable use of custom helicopter rotors in game (but not GUI windows yet) (mart3p) 18 years ago
peter1138 c6d48f9235 (svn r4642) - Codechange: reorganise airport.h and airport_movement.h to avoid having 8 copies of the airport FTAs, and make the enums used available elsewhere. 18 years ago
celestar 6c5e9fe311 (svn r4465) -Codechange (FS#60): Remove a variable no one really needs. (DaleStan) 18 years ago
tron 35e93e451f (svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
Remove DoCommandByTile(), because now it does the same as DoCommand()
18 years ago
celestar 6443c14ebd (svn r4246) -Codechange. Replaced about 100 occurences of '16' by TILE_SIZE 19 years ago
tron c40740e058 (svn r4120) Use the new station functions where appropriate 19 years ago
tron f6285a659c (svn r4079) Add GetSation{Index,ByTile}() to get the station index resp. the station from a tile 19 years ago
tron 00cf5c9acf (svn r3832) Replace some magic numbers by (Diag)Direction enums 19 years ago
tron 7a0071cc53 (svn r3829) Reduce the use of _error_message by directly returning error codes instead of using this global variable 19 years ago
tron fa6632ec32 (svn r3786) More work for DirDiff 19 years ago
tron 9273d0d2b9 (svn r3784) Add a type and functions to handle direction changes 19 years ago
tron 8cfcdaa733 (svn r3783) Replace further ints and magic numbers by Direction, DiagDirection and friends 19 years ago
tron ca0862c3f4 (svn r3758) Remove the news validation callback. It is superseded by r3757. 19 years ago
tron 332b54d5a6 (svn r3757) -Feature: Delete news items about vehicles, when they get stale
This is used to delete
- all news about a vehicle, when it gets deleted
- "vehicle has stopped in depot" news, when it gets started
- "vehicle has invalid orders" news, when the orders get changed
19 years ago
peter1138 f9b4537228 (svn r3588) - Refit: Use only one global to return the refit capacity rather than one per vehicle type. 19 years ago
tron 50fd9c8f73 (svn r3585) Similar changes to the order handlers of the other vehicle types like r3584 19 years ago
tron 087fe86ed2 (svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
19 years ago
peter1138 6c28b1cec7 (svn r3524) - Split newgrf features from engine.[ch] into newgrf_engine.[ch], and add the new files to project files. 19 years ago
tron 1c3e8630fe (svn r3511) More whitespace ([FS#46] by Rubidium) 19 years ago
bjarni 2b31f5fe7e (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
peter1138 2222907a40 (svn r3396) - Autoreplace changes:
- Change fixed array per player to a single pool. This avoids future problems
    with vehicle numbers and decreases savegame size. Engine replacements from
    previous savegames will be lost.
  - Move engine replacement code from players.c to engine.c.
                                      (thanks to blathijs for rewriting this)
19 years ago
tron 2053685fb5 (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
peter1138 901068fd6e (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 9822b4d755 (svn r3297) Staticise 19 years ago
peter1138 0b48a69e02 (svn r3248) - Codechange: Change interface of CanRefitTo() to supply the engine type directly instead of getting it from a vehicle. This allows the function to be used before vehicles are involved. 19 years ago
peter1138 14064b223d (svn r3239) - Codechange: Introduce and use helper functions for engine replacement code. 19 years ago
tron d09db07ca1 (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 3bdb92446c (svn r3196) Use structs instead of magic offsets into arrays 19 years ago
tron 9d0e7b6458 (svn r3181) -Bracing
-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
19 years ago
tron 524fd25cbd (svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT 19 years ago
tron 81e5b16d71 (svn r3172) static, const 19 years ago
bjarni 1b3e626ff9 (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 3c1dd61bf1 (svn r3138) -Fix: [clone vehicles] fixed assert when it was possible to 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
19 years ago
bjarni fa5ca040e9 (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 f0629b5fc3 (svn r3105) readded 2 line that should not have been removed in last commit(3104). Now cargo are removed when refitting (like it should) 19 years ago
bjarni 3e7f281519 (svn r3104) -Codechange: [refit] removed now obsolite code that the old autoreplace needed 19 years ago
bjarni 17d341b902 (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
tron 7c14b86aaf (svn r3098) static, const, uint -> TileIndex, indentation, bracing, unused return values, ... mostly related to the clone vehicle GUI 19 years ago
bjarni 0f5c8787f8 (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 181d586a7c (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 53a4a6a0f4 (svn r3046) Replace some numbers with sprite names and fix a typo in the sprite list 19 years ago
tron f556128dde (svn r3030) More work for GB/SB, this time concerning the waiting_acceptance attribute of stations 19 years ago
tron 6d7c7e67b2 (svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them 19 years ago
tron 0ad3902acf (svn r3003) Change int, uint, uin16 and byte to EngineID where appropriate, plus some related changes (mostly casts) 19 years ago
tron 980808dac2 (svn r3001) s/Player*/const Player*/
s/byte/PlayerID/
s/int/PlayerID/
and related changes
19 years ago
peter1138 9e20ae4222 (svn r2990) Remove _engine_original_sprites and replace all uses with references to our (new) original engine/vehicle tables. 19 years ago
Darkvater da2fa233d7 (svn r2949) The AI no longer needs to 'cheat' to build aircraft; eg it builds them now from a hangar. Also, to query the price of a new aircraft tile information is not needed 19 years ago
truelight 4936e93654 (svn r2948) -Fix: the old AI needs a special flag that triggers all kind of special
abilities you really don't want to know about (free bridges, etc..)
       I removed this flag some revisions ago, but the Aircraft part
       depends on it, so I re-enabled it again..
19 years ago
tron 86fcdfbe2e (svn r2890) Fix some signed/unsigned comparison warnings (tokai) 19 years ago