peter1138
f9b4537228
(svn r3588) - Refit: Use only one global to return the refit capacity rather than one per vehicle type.
2006-02-11 09:24:51 +00:00
tron
50fd9c8f73
(svn r3585) Similar changes to the order handlers of the other vehicle types like r3584
2006-02-10 06:33:56 +00:00
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
2006-02-06 09:18:04 +00:00
peter1138
6c28b1cec7
(svn r3524) - Split newgrf features from engine.[ch] into newgrf_engine.[ch], and add the new files to project files.
2006-02-03 12:55:21 +00:00
tron
1c3e8630fe
(svn r3511) More whitespace ([FS#46] by Rubidium)
2006-02-01 07:36:15 +00:00
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
2006-01-18 14:12:26 +00:00
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)
2006-01-12 15:52:18 +00:00
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
2006-01-05 21:35:54 +00:00
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.
2005-12-28 22:29:59 +00:00
tron
9822b4d755
(svn r3297) Staticise
2005-12-14 06:20:23 +00:00
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.
2005-11-29 22:29:59 +00:00
peter1138
14064b223d
(svn r3239) - Codechange: Introduce and use helper functions for engine replacement code.
2005-11-26 16:41:14 +00:00
tron
d09db07ca1
(svn r3204) Make handling of clicking on vehicles a bit less ugly by avoiding function declarations in .c files and unnecessary indirection
2005-11-16 12:52:01 +00:00
tron
3bdb92446c
(svn r3196) Use structs instead of magic offsets into arrays
2005-11-16 12:01:46 +00:00
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
2005-11-14 19:48:04 +00:00
tron
524fd25cbd
(svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT
2005-11-14 08:09:57 +00:00
tron
81e5b16d71
(svn r3172) static, const
2005-11-13 13:43:55 +00:00
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
2005-11-08 23:18:09 +00:00
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
2005-11-05 14:01:00 +00:00
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)
2005-10-31 12:59:47 +00:00
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)
2005-10-30 15:50:08 +00:00
bjarni
3e7f281519
(svn r3104) -Codechange: [refit] removed now obsolite code that the old autoreplace needed
2005-10-30 11:00:54 +00:00
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()
2005-10-29 21:54:28 +00:00
tron
7c14b86aaf
(svn r3098) static, const, uint -> TileIndex, indentation, bracing, unused return values, ... mostly related to the clone vehicle GUI
2005-10-28 20:04:54 +00:00
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
2005-10-24 19:40:48 +00:00
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
2005-10-23 13:04:44 +00:00
tron
53a4a6a0f4
(svn r3046) Replace some numbers with sprite names and fix a typo in the sprite list
2005-10-15 11:06:54 +00:00
tron
f556128dde
(svn r3030) More work for GB/SB, this time concerning the waiting_acceptance attribute of stations
2005-10-11 13:54:21 +00:00
tron
6d7c7e67b2
(svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them
2005-10-03 21:20:01 +00:00
tron
0ad3902acf
(svn r3003) Change int, uint, uin16 and byte to EngineID where appropriate, plus some related changes (mostly casts)
2005-10-01 12:43:34 +00:00
tron
980808dac2
(svn r3001) s/Player*/const Player*/
...
s/byte/PlayerID/
s/int/PlayerID/
and related changes
2005-09-30 20:37:25 +00:00
peter1138
9e20ae4222
(svn r2990) Remove _engine_original_sprites and replace all uses with references to our (new) original engine/vehicle tables.
2005-09-26 19:01:49 +00:00
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
2005-09-13 13:30:18 +00:00
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..
2005-09-13 12:19:27 +00:00
tron
86fcdfbe2e
(svn r2890) Fix some signed/unsigned comparison warnings (tokai)
2005-08-25 16:53:51 +00:00
ludde
d0bbfbc7ae
(svn r2842) Fix bug with aircraft autoreplace (peter1138)
2005-08-08 15:26:53 +00:00
bjarni
9952ff0b59
(svn r2817) -Codechange: [autoreplace]: moved autoreplace and autorenew to 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)
2005-08-06 16:07:22 +00:00
bjarni
059ae19626
(svn r2764) -Feature: Clone vehicles
...
-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-31 13:08:08 +00:00
celestar
1e67dfffe7
(svn r2732) -Codechange: Cleaned the order flags some more. Hit some inconsistencies while trying to locate bug 1244167
2005-07-28 06:09:15 +00:00
tron
647cbd6bdd
(svn r2701) Insert Id tags into all source files
2005-07-24 14:12:37 +00:00
tron
54cbd01825
(svn r2673) Include functions.h directly, not globally via openttd.h
2005-07-22 07:02:20 +00:00
tron
f09638ad3d
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
2005-07-20 15:29:28 +00:00
tron
7269771544
(svn r2643) Get rid of some unnecessary casts
2005-07-19 21:49:35 +00:00
tron
a4bf608d40
(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.
2005-07-13 18:04:01 +00:00
tron
62b5e913c6
(svn r2504) Move Draw*EngineInfo to engine_gui.c to reduce dependencies
2005-07-01 14:05:44 +00:00
tron
2b73dec567
(svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY
2005-06-25 06:15:43 +00:00
tron
a733fede9b
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
2005-06-24 12:38:35 +00:00
tron
d2364f1d51
(svn r2432) Use GetEngine() instead of DEREF_ENGINE() or even _engines[]
2005-06-07 18:13:49 +00:00
tron
a9b95b3cbb
(svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
2005-06-04 11:56:32 +00:00
tron
80aa6af8e3
(svn r2403) if cascade -> switch
2005-06-03 22:25:06 +00:00