bjarni
7d967ad12a
(svn r1741) - Fix: added IsVehicleIndex() so it's possible to protect GetVehicle() from reading an invalid vehicle index
...
- Fix: added check for v->type in some commands, which expects v to be a specific type
Checks like this is needed to protect network servers from people, who hack their clients to either cheat or crash the server
NOTE: if I made a mistake here it can make a function unreachable when it should be used. Here is one place to look if something weird happens
2005-01-30 20:50:06 +00:00
celestar
fb3af3321a
(svn r1740) -Fix: [ 1112342 ] Realistic acceleration works properly with TTDPatch non-stop handling behaviour
2005-01-30 19:51:39 +00:00
darkvater
bc0198a4c3
(svn r1739) - Fix: type checking when selling vehicles (TrueLight)
2005-01-30 18:51:08 +00:00
celestar
39c55d0eb3
(svn r1738) -Fix: [ 1108735 ] Fixed (hopefully) an assertion that was cause by selling carriages in a MP game faster than the network can handle. (Truelight)
2005-01-30 18:40:52 +00:00
bjarni
3103119b6c
(svn r1727) - Fix: now CmdBuildRailVehicle() behaves correctly if DC_EXEC is set
...
this commit alters ai.c a little to get rid of the workaround from r1725 so AI players could still build locomotives
2005-01-30 13:03:32 +00:00
bjarni
001cdf0ba2
(svn r1725) - Fix: now trains can only be built in depots and you have to own the depot too (hacked client protection)
2005-01-29 23:58:07 +00:00
tron
38587b60f7
(svn r1718) Use the enum TileType as parameter/return type for [GS]etTileType() instead of plain int.
...
This makes it necessary to rename TileType() to GetTileType() because a type and a function may not share the same name.
2005-01-29 15:12:40 +00:00
tron
39858e696b
(svn r1713) Split off several functions which query/set information about a single tile from map.h and put them into a seperate file tile.h
2005-01-29 12:19:05 +00:00
bjarni
f853483424
(svn r1712) - Fix: a hacked client can no longer send other players trains to a depot
...
- Feature: [autoreplace] trains now tries to find a depot if they needs to be replaced
Now all 4 types of vehicles goes to a depot if they needs to be replaced
2005-01-29 12:01:36 +00:00
tron
dba55a5742
(svn r1701) Style police ^^
2005-01-27 21:18:03 +00:00
bjarni
72b9358291
(svn r1700) - Fix: Hacked clients can no longer be used to build vehicles that are not available yet (Hackykid)
2005-01-27 21:00:05 +00:00
tron
372b9cb827
(svn r1696) Use GetTileSlope() instead of FindLandscapeHeightByTile() where it is sufficient. FindLandscapeHeightByTile() uses GetTileSlope() internally and adds some more info, which is discarded in these cases.
...
While touching the code make a bit more clear how GetBridgeHeight() works.
2005-01-27 12:52:20 +00:00
celestar
ccd4f53a34
(svn r1681) -Feature: New realistic acceleration.
...
This will make things more difficult as narrow curves
and depots impose rather strict speed limits. Feedback welcome
For those who don't like low-speed curves: Switch it off
2005-01-26 12:51:04 +00:00
tron
07cb3068ae
(svn r1676) Increase the size of TileIndex and TileIndexDiff to 32bits and adapt the save/load data and some other parts of the code to that change
...
WARNING: If i made any mistake here it WILL lead to corrupted savegames!
2005-01-25 21:43:57 +00:00
bjarni
f7774a007a
(svn r1652) Fix: train and road vehicle lists are now redrawn when vehicles enters/leaves a depot (Hackykid)
...
fix: the ship status bar was not updated properly after a breakdown if show_speed was off (Hackykid)
2005-01-24 22:24:47 +00:00
celestar
3bd60674b8
(svn r1638) -Fix: Train crashes should no longer desync the game. This is more of a
...
workaround, as somewhere there might be some InteractiveRandom() abuse
in the code.
2005-01-24 14:39:22 +00:00
darkvater
59e099149c
(svn r1633) -Fix: [1040119] Flood and wagons in depot
2005-01-24 00:36:22 +00:00
bjarni
cf862380fc
(svn r1629) added a counter to tell how many engines you have of each type to the autoreplace vehicle windows and made them show only the vehicles you actually have in the left list.
...
this also fixes some window updates issues when autoreplacing
2005-01-23 22:01:51 +00:00
tron
81ee2d931b
(svn r1610) Remove trailing whitespace (last time ever, i hope)
2005-01-23 13:09:35 +00:00
dominik
9b9cdb1bad
(svn r1604) Fix: [ 1105112 ] Destroyed train locks crossings
2005-01-23 10:40:54 +00:00
tron
97f893ae2f
(svn r1596) Add some more statics
2005-01-22 22:47:58 +00:00
tron
94d5aeabb2
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
2005-01-22 20:23:18 +00:00
celestar
a81b5187ab
(svn r1588) -Fix: [ 1105959 ] coded a workaround in the acceleration code so that
...
trains don't think they're on a slope while they drive around in a
tunnel
2005-01-22 18:39:52 +00:00
bjarni
467e4b82bf
(svn r1568) made an enum of train subtypes to make the code more readable
2005-01-19 19:15:03 +00:00
celestar
321c753418
(svn r1565) -Fix: [ 1104969 ] Aircraft in hangar messages are now revalidated before
...
display
-CodeChange: replaced one if (foo) return true else return false by
return (foo)
2005-01-19 10:00:37 +00:00
bjarni
5f549396f4
(svn r1561) Fix: autoreplacing a singleheaded engine into a dualheaded engine now adds the the rear engine
...
autoreplacing a dualheaded engine into a singleheaded engine now sells the rear engine
as a sideeffect of this, the price for replacing both engines are now added and displayed once from the depot(instead of two identical numbers written on top of each other, looking like one)
fix: cost for autorenew dualheaded engines were doubled and their value where doubled too
2005-01-18 23:27:06 +00:00
Celestar
7768e97fa6
(svn r1558) -Fix: [ 1104350 ] Crashed trains do not initiate the lost vehicle
...
message anymore
2005-01-18 16:01:35 +00:00
celestar
6330806531
(svn r1554) -Fix: [ 1103187 ] Order Check messages are now validated before
...
displayed, so that there are no stray error messages any more.
-Feature/Fix: Order Checking is only execute for ONE vehicle in an
order-share system
2005-01-17 21:54:45 +00:00
tron
7469164eb1
(svn r1550) Remove useless function declaration
2005-01-17 09:43:02 +00:00
tron
7ff921855a
(svn r1549) Clean up some functions:
...
uint tile -> TileIndex tile
if () cascade -> switch ()
2005-01-17 09:41:46 +00:00
tron
61a6bc544d
(svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
2005-01-16 11:24:58 +00:00
truelight
7cafdf3b0b
(svn r1525) -Codechange: rewrote the _order_array, now it can be made dynamic.
...
-Codechange: renamed all 'schedule' stuff to 'order(list)'
-Codechange: moved all order-stuff to order_cmd.c / order.h
-Codechange: vehicles that share orders are now linked to eachother
with next_shared/prev_shared in Vehicle
Developers: please use AssignOrder to assign data to an order. If not,
you _WILL_ make the save-routine to assert!
2005-01-15 19:06:22 +00:00
truelight
d9ea82a886
(svn r1445) -Fix: reversing a train also reverses the UP and DOWN status for the
...
realistic acceleration calculation
-Fix: there was a big bug in setting the UP and DOWN flags making it
easy possible for a overloaded train to go up a mountain. This is no
longer possible. They will hang at a certain height
2005-01-09 16:02:06 +00:00
tron
414ac3286b
(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY]
2005-01-07 17:02:43 +00:00
truelight
b450603437
(svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns and _industries
...
(in prepare of dynamic arrays):
- DEREF_XXX is changed into GetXXX
- All direct call are directed via GetXXX
- struct Industry has now an index-field
- ENUM'd some stuff
- Replaced home built loops with FOR_ALL_XXX
- Added _stations_size, _vehicles_size, ... which gives the length of the
array (which will be dynamic in the near future)
- Changed lengtof(XXX) to _XXX_size (e.g. _stations_size)
- Removed all endof(XXX) (because mostly it was part of a FOR_ALL_XXX)
- Made the sort-functions of all 4 dynamic
- Made all 4 Initialize functions more of the same
- Some minor tab-fixing and stuff
(tnx to Tron for proof-reading my 100kb patch ;))
Note for all: please do NOT directly call _stations, _vehicles, _towns and
_industries, but use the right wrapper to access them. Thank you.
Ps: please also do not use 'v++', where v is of type Vehicle *.
2005-01-06 22:31:58 +00:00
tron
2eb7aedf69
(svn r1402) Trim trailing whitespace
2005-01-06 18:45:28 +00:00
tron
e4cf2ba1b3
(svn r1386) Move TileIndexDiff to map.h
...
Move _tileoffs_by_dir to map.[ch] and encapsulate it in TileOffsByDir()
2005-01-05 13:32:03 +00:00
darkvater
fc52b512aa
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
2005-01-04 17:11:03 +00:00
matthijs
a3d687fadb
(svn r1367) -Fix: Full-Loading trains no longer get "lost" after a while (Hackykid)
2005-01-04 00:54:12 +00:00
bjarni
5da75918c0
(svn r1323) Adding autoreplace feature
...
This feature works much like autorenew, but it will get you a new engine type instead of a new one of the same type. Once
ordered, it will automatically replace the engines while they visits a depot. The GUI for setting this up have been added on the
vehicle overview windows
Note: autorenew is now autoreplace, but to the same engine type
Nice new features, that was added to make this possible
- windows can now have two independant vertical scrollbars
- CMD_SHOW_NO_ERROR have been added as a flag for DoCommandP. It will make it do the action instead of showing the red box with
estimated costs even if shift is pressed
- fixed problem where enginetypes where not initialized when loading a game. It's now done in InitializeGame()
2005-01-02 17:23:04 +00:00
truelight
2f9e0b8e0c
(svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
...
an uint8 till the savegame version is bumped to version 5. Then it works
automaticly as a fully uint16. So _stations[] can not be increased till
after the bump!!
2004-12-28 11:51:31 +00:00
truelight
c0eeb710c7
(svn r1283) -Add: AutoRenew is now a client-side patch instead of a game-side patch
...
Note: this is the first commit that breaks compatibility with 0.3.5!
-Fix: Bufferoverflow with autorenew_money. It is now a 32-bit integer.
2004-12-27 18:18:44 +00:00
darkvater
452db59121
(svn r1211) -Feature: Introduce sticky windows to all vehicle windows...Just make sure you do not sticky more than 23 at a time. Also a lot of places in the code invalidated the 'status bar' of the vehicle, referring to it as widget 4. This is now widget 5 and has been #definitized
2004-12-21 23:27:58 +00:00
truelight
b4aa5e7572
(svn r1200) -Fix: Fixed bug pointed out by Tron: when a train is on the
...
road/rail-crossing, and you let an other train drive towards it, reverse
it, the lights no longer go off.
2004-12-21 16:17:27 +00:00
truelight
63611e19f5
(svn r1199) -Fix: [ 958098 ] No longer road/rail crossing signals hang when a train
...
is reversed at the wrong moment (Yeah, our longest open bug finally
fixed :) :) :))
2004-12-21 16:02:14 +00:00
truelight
d78ddb39bb
(svn r1198) -Fix: [ 1087701 ] It is no longer possible to crash trains of other
...
companies by building a depot close to a station. (even more: trains do
no longer enter tiles that do not belong to his owner)
2004-12-21 16:00:14 +00:00
tron
7875eb7c64
(svn r1189) Fix vehicle list update glitch when moving waggons in depots
2004-12-20 18:11:22 +00:00
dominik
ed99219348
(svn r1167) Feature: Added the possibility to add validation functions to NewsItems. This is now done for "Train in depot" messages. Before displaying such a message, it checks if the train really still is in the depot. Can be applied to other news items as well.
2004-12-19 09:39:19 +00:00
tron
a148ff4e0d
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
2004-12-15 22:18:54 +00:00
tron
03910ce7e9
(svn r1015) MFM r789
...
Replaced the slightly misleading SERVICE_INTERVAL by a function VehicleNeedsService()
2004-12-11 10:17:10 +00:00
tron
13e8d01dcb
(svn r1009) -Feature: per-station vehicle lists
...
This adds a little button per vehicle class to the station window which opens a list of all vehicles that have this station on their schedule.
As side effect this gets rid of some global variables.
2004-12-10 18:16:08 +00:00
bjarni
c6cd07e2e3
(svn r998) now vehicles are serviced both when entering and when leaving depots to prevent that vehicles might need service when leaving after a long stay (ln--)
2004-12-09 21:46:56 +00:00
tron
b8e83ca03f
(svn r955) Replace uint16 for orders with struct Order
...
This adds no functionality, but is a stepping stone for future improvement (like 16bit order indices) and is easier to read.
This changes preserves binary compatibility wrt savegames.
2004-12-05 12:43:04 +00:00
tron
291d25a88b
(svn r925) Use sound enums
...
Also play the correct sound when a toyland road vehicle breaks down
2004-12-04 09:26:39 +00:00
tron
b88fc15e47
(svn r924) Use RailVehInfo() instead of &_rail_vehicle_info[]
2004-12-04 07:41:37 +00:00
tron
265ac67183
(svn r901) Small step in the process to clean up the DPARAM mess:
...
- reduce to 2 sizes (*DParam64 for 64bit values, *DParam for the rest)
- use inline functions instead of macros
- add assert()s to check for buffer overruns
2004-12-02 22:53:07 +00:00
tron
acbd1801c7
(svn r815) Include strings.h only in the files which need it.
...
This should reduce the compile time after altering english.txt by about 1/3, because "only" 62 instead of 90 .c files must be recompiled.
2004-11-25 10:47:30 +00:00
tron
0b3cceb21d
(svn r785) -Fix: A train can leave and enter the same depot at the same time, then the trai simply got stuck
2004-11-23 20:25:18 +00:00
pasky
2214a9df5c
(svn r773) When refitting a train engine, refit also all the attached wagons which can be refitted (applicable to DBSetXL, as shown in http://pasky.or.cz/~pasky/dev/openttd/screenshots/wagrefit.png ). This is how TTDPatch does it, pointed out by Bjarni.
2004-11-22 23:05:34 +00:00
tron
13f0b6c0cf
(svn r654) Hopefully complete support for randomized variational spritegroups (i.e. the cars transporter in DBSetXL gets different cars each time) (pasky)
2004-11-17 08:52:47 +00:00
tron
249a170ace
(svn r607) -Patch: [ 985102 ] static cleanup
...
Thanks to lvoge
2004-11-14 19:44:06 +00:00
darkvater
397cc50f61
(svn r587) -newgrf: Rename all /Checkpoint/i tokens to 'Waypoint's. The name actually makes some sense and is also compatible with TTDPatch (pasky).
2004-11-14 13:07:07 +00:00
darkvater
e7441c39e3
(svn r546) -newgrf: Use GetCustomVehicleIcon() for fetching sprites for vehicle selection dialogs. (Idea by octo, done by pasky).
2004-11-12 17:16:13 +00:00
tron
d641175e3c
(svn r513) Merge revisions 402, 416, 417, 478, 479, 511, 512 from map to trunk
...
This includes 2 fixes
-Fix: [1048596] Monorail and Maglev sounds are swapped (r511)
-Add special case to load the jackhammer sound (r478)
The rest are cleanups und enumeration to make merging possible/easier
2004-11-05 23:12:33 +00:00
darkvater
36f18e7f40
(svn r314) -Fix: [982611] Pathfinding bug; train likes the roundabout. If train needs servicing it will now look 16 tiles along the track instead of 12 tiles manhattan style (blathijs)
2004-09-23 21:20:38 +00:00
darkvater
475ef74ab7
(svn r306) -Fix: [985439] un-owned rail. Trains could cross competitor's tracks if there was a road-crossing over it.
2004-09-21 21:28:42 +00:00
darkvater
089a2a7847
(svn r294) -Fix: autorail always builds rail, instead of occasional rail removal (on pressing hotkey after pressing 'bulldozer')
...
-Fix: network fixes (Tron)
-Some textfile changes, mainly URL's
2004-09-18 16:40:06 +00:00
darkvater
4757c0bf8c
(svn r245) -Fix: [1022689] Bug when dragging a part of a multiheaded engine to 'sell-whole-train'. The rear-head of the multiheaded train will now not be sold automatically. You have to drag it manually (Celestar)
2004-09-14 14:26:12 +00:00
signde
5e699ca65d
(svn r243) -Fix: [1022689] When destroying a part of a train with a 2 side engine the second engine was also deleted [Celestar]
2004-09-14 08:13:15 +00:00
truelight
eb49a19460
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
2004-09-10 19:02:27 +00:00
truelight
d2dd128b0d
(svn r167) -Fix: [972247] bug in '[a] weird non-uniform stations handling'
...
(blathijs)
2004-09-06 18:33:51 +00:00
darkvater
bf0652d3fc
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
...
-Fix: Sorter icon pointing down 'v' sorts in every window lowest value first, '^' highest value first
-CodeChange: move Dropdownlist from settings_gui.c to widget.c. More in place there.
2004-09-06 18:15:13 +00:00
truelight
10d54ac604
(svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)
...
-Fix: some minor fixes around GetTileTrackStatus (blathijs)
2004-09-05 16:15:22 +00:00
darkvater
85628544ee
(svn r157) -Feature: [1009708] Percent-based service intervals. Send a vehicle to depot after it has lost X% of its reliability (mivlad)
2004-09-04 13:06:09 +00:00
dominik
c7baa9b10a
(svn r104) Fix: wrong pathfinding when northern station tile is missing (blathijs)
2004-08-21 23:56:01 +00:00
dominik
e1d92ebcc9
(svn r99) Fix: [992726] No tunnel crash (Celestar)
2004-08-21 09:57:02 +00:00
truelight
4b919416a2
(svn r77) -Fix: [1010788] AI service interval bug (tnx truesatan)
...
-Add: AI overrides service interval to 180 days
-Fix: AI hanged when all vehicles were disabled in Patch menu
2004-08-17 16:20:04 +00:00
truelight
4e3ad7598f
(svn r74) -Fix: [1009631] Wrong multihead selling (Bodewes)
2004-08-17 09:29:26 +00:00
darkvater
f422014960
(svn r23) -Some omments on the code (blathijs)
2004-08-11 22:07:08 +00:00
dominik
6f8e7943c5
(svn r20) Feature: warning when a vehicle has invalid orders (celestar)
2004-08-11 10:15:38 +00:00
dominik
9c4abb643c
(svn r16) Fix: Train refit cost based on _price.ship_base
2004-08-10 21:28:43 +00:00
dominik
a9413b12a2
(svn r12) Change: removed patch no_train_service. Instead you can set the default service interval for any vehicle type to 'disabled'.
2004-08-10 17:06:10 +00:00
truelight
efaeb275f7
(svn r1) Import of revision 975 of old (crashed) SVN
2004-08-09 17:04:08 +00:00