Commit Graph

127 Commits

Author SHA1 Message Date
tron 0973dc78cd (svn r5614) Move a type declaration to its only user 2006-07-26 08:41:14 +00:00
tron 16bf3e35cd (svn r5613) Rename VS_DISASTER to VS_SHADOW, because this is what this flag actually means 2006-07-26 08:32:20 +00:00
tron 2b27073156 (svn r5391) Miscellaneous, mostly bracing and whitespace, nothing spectacular 2006-06-27 21:25:53 +00:00
tron be88e269b9 (svn r5155) - Remove the bridge branch merge (revision r5070) 2006-06-07 19:35:21 +00:00
peter1138 d286235a6a (svn r5146) - NewGRF: Support selection of aircraft default cargo type by checking its refit mask. If aircraft can be refitted to passengers, no change happens, else the first refittable type is chosen. Also use refit capacity to determine the default capacity. 2006-06-07 07:20:28 +00:00
tron a0caafeb50 (svn r5094) Remove _new_{aircraft,roadveh,ship,train,wagon}_id. _new_vehicle_id is enough. 2006-06-04 09:28:33 +00:00
celestar 25a63ec7af (svn r5070) Merged the bridge branch
-Feature: Bridges can now be placed above:
	Any railway track combination (excluding depots and waypoints)
	Any road combination (excluding depots)
	Clear tiles (duh), including fields
	Tunnel entrances
	Bridge heads

Thanks to Tron for idea and implementation, KUDr for the yapf synchronization and many others for hours of testing

There are still a number of visual problems remaining, especially when electric railways are on or under the bridge.
DO NOT REPORT THOSE BUGS FOR THE TIME BEING please.
2006-06-02 13:05:41 +00:00
tron 1706164ff7 (svn r4937) Reduce the use of _error_message a bit 2006-05-21 11:34:08 +00:00
peter1138 cd6ab6178c (svn r4910) - NewGRF: add and initialize cargo subtype for vehicle visual variations 2006-05-19 10:04:03 +00:00
celestar e75e4e8f74 (svn r4466) -Fix: (FS#71) Game no longer crashes when the last vehicle serving a station has been deleted.
-Negative side effect: upon loading old games, stations whose last vehicle was a station have (temporarily) lower ratings.
   -Positive side effect: station.h no longer includes vehicle.h (breaks the station.h->vehicle.h->rail.h chain)
2006-04-18 08:50:17 +00:00
celestar 5931b34aff (svn r4259) -[multistop] Fix/Feature/Codechange:
1) Improved the road vehicle allocation (aka slotting) for multistop. Stops can now accept unlimited, er... 256, vehicles.
2) Removed the "wait for stop" feature, because it did not work in practise.
3) Slotting now ignores unreachable stations. Uses NPF at the moment because the old pathfinder cannot do it (yet)
4) Now matter how many vehicles approach a station, they will always be distributed evenly over existing stops.
5) Hopefully the last fundamental change to multistop
2006-04-03 14:25:32 +00:00
celestar a7d8ad0004 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas. 2006-03-29 16:30:26 +00:00
Darkvater 2c27f45cdc (svn r4131) - CodeChange: Add proper semantics for StationID for such variables instead of using the general uint16-type. StationID was added for depots, waypoints and stations where necessary. We probably need to change GetDepot(), IsDepotIndex(), IsStationIndex(), GetWaypoint() and IsWaypointIndex() as well to use StationID. 2006-03-26 22:55:27 +00:00
Darkvater d5909f901a (svn r4128) - CodeChange: Add proper semantics for CargoID for such variables instead of using the general byte-type. 2006-03-26 22:23:32 +00:00
tron cda8934a55 (svn r4120) Use the new station functions where appropriate 2006-03-26 19:20:15 +00:00
bjarni a36f8a46fa (svn r3944) -Feature: it's now possible to turn a single unit in a train
control-click on a unit in a train in a depot will make the click unit turn around
	this is useful if you want "normal" engines to act as dualheaded (one each way) or similar
	this only works on single unit units. Multiheaded and articulated engines get a red error box
	this is based on a quick hack peter1138 while I made it network safe and correctly handling of multible unit engines
2006-03-18 13:00:32 +00:00
peter1138 9c7f09322e (svn r3805) - [FS#62] Fix doxygen comments to refer to the correct parameter. (sulai) 2006-03-09 20:37:51 +00:00
tron 78a7b15ce0 (svn r3803) Change the second parameter of UpdateSignalsOnSegment() from Direction to DiagDirection as that's what it really operates on 2006-03-09 12:32:25 +00:00
tron fbe939b31f (svn r3783) Replace further ints and magic numbers by Direction, DiagDirection and friends 2006-03-08 06:55:33 +00:00
tron 2d3c28f2b3 (svn r3776) Replace many ints and magic numbers by Direction, DiagDirection and friends 2006-03-06 20:28:28 +00:00
celestar 9d54e51ef9 (svn r3730) Multistop modifications:
-Codechange: Completely rewritten the slot assignment system. It now consumes less CPU cycles and memory
-Codechange: Increased maximum number of roadstops to 16.
-Fix: Several conditions where a slot becomes unliked from a vehicle
-Codechange: ClearSlot now only takes one parameter, the vehicle
-Feature: Console command 'clearslots' to clear ALL currently assinged slots. debug usage only
-Feature: vehicles that cannot get a slot now wait on the road instead of planlessly blocking stops or circling around
-Codechange: Adjusted debug levels
TODO: Make the slot finder compatible with (a) pathfinder(s).
2006-03-02 08:55:12 +00:00
peter1138 24217d5c8d (svn r3701) [2cc] move vehicle/engine palette functions out of header file and document the remaining definitions 2006-03-01 17:35:01 +00:00
peter1138 4f9ea7640a (svn r3620) - 2cc: Replace use of macro to determine colour map with a function call for drawing of vehicles. 2006-02-20 09:26:07 +00:00
peter1138 601b226f04 (svn r3602) - Move _railveh_score data to _rail_vehicle_info->ai_rank and remove global variable to return data as we can now access this directly. 2006-02-13 22:13:02 +00:00
peter1138 efe76c22e6 (svn r3589) - Rename u.road.unk2 to u.road.blocked_ctr 2006-02-11 10:45:20 +00:00
peter1138 6f5f3101b6 (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
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.
2006-01-29 18:57:26 +00:00
bjarni e35a131153 (svn r3403) -Codechange: [multiheaded engines] the references between the front and rear engines are no longer saved
instead the pointers are generated on load
2006-01-18 15:05:01 +00:00
peter1138 90aff7a026 (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 5ac1a89f92 (svn r3366) Make an unnecessarily global variable local 2006-01-05 16:51:10 +00:00
tron e272b03fee (svn r3365) Staticise 36 functions 2006-01-05 12:40:50 +00:00
peter1138 4b464093e7 (svn r3362) Fix issue with loading old (TTD) savegames:
- move call to convert from old to new train subtypes.
 - ensure AI is started for AI players.
2006-01-04 20:18:39 +00:00
tron 246c126d25 (svn r3353) Simplify the automatic length adjustment algorithm for replacing trains: Use the length of the train before the replacement as reference length 2005-12-29 12:42:59 +00:00
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. 2005-12-28 22:29:59 +00:00
peter1138 fde99748c0 (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
bjarni 22a4679837 (svn r3218) -Feature: Multiheaded train engines will now stay in the same train
This means that any user attempt to remove a rear engine will tell the user to move the front engine instead
	This fixes the assert when moving multiheaded engines (introduced in r3144)
	Note: to make old savegames use this feature, some engines might be turned around in order to link engines in pairs

-Codechange: train subtype is now a bitmask
	This allows fast access to info like if it is a wagon or engine and if it is in front and so on
	Note: savegame version bump
2005-11-18 23:41:03 +00:00
tron 89cfe202b8 (svn r3208) Don't explicitly pass the engine type to look for to GetRearEngine(), because it's the engine type of the vehicle which gets passed as first parameter 2005-11-16 14:07:34 +00:00
tron 7a7847ed61 (svn r3200) Remove the unused function GfxScalePalette() and the unused struct WorldSprite 2005-11-16 12:21:04 +00:00
tron 62b2b4613f (svn r3193) Staticise the vehicle position hash 2005-11-16 11:50:40 +00:00
tron f7abff5f96 (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 357aba7475 (svn r3176) Use proper types, not some variants of int 2005-11-13 21:16:34 +00:00
tron ee15e3de13 (svn r3172) static, const 2005-11-13 13:43:55 +00:00
bjarni 5481dcd191 (svn r3155) -Feature: [autoreplace] autoreplace can now remove cars from too 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 23:20:47 +00:00
peter1138 267314b4d0 (svn r3139) -NewGRF, Feature: support for articulated rail vehicles. This is used, for example, by coal tenders. 2005-11-05 16:07:26 +00:00
bjarni d86829d0e0 (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 c8ea743e47 (svn r3136) -Fix: [autoreplace] all cargo in engines that consists of more 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 20:52:03 +00:00
peter1138 081bae03d9 (svn r3132) -NewGRF: support positioning of rail vehicle visual effects. 2005-11-04 12:58:18 +00:00
peter1138 e80d448478 (svn r3124) Alter train loading/unloading time to use the actual length of the train instead of the number of wagons. The actual length is cached in the first vehicle of the train. 2005-11-03 09:22:24 +00:00
bjarni 59913ae719 (svn r3116) -Fix: [autoreplace] fixed issue where autorenewing/autoreplacing a plane could lock up an airport
this will not fix already locked up airports
        this bug was introduced in rev 3111
2005-11-01 17:20:06 +00:00
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)
2005-10-31 12:59:47 +00:00