Commit Graph

384 Commits

Author SHA1 Message Date
glx b0e8d229ee (svn r10383) [0.5] -Fix (r10373, FS#958): v->z_pos was wrong for trains on bridge 2007-06-29 00:26:10 +00:00
rubidium cd32a5f18c (svn r10373) [0.5] -Backport from trunk (r10306, r10311, r10317, r10339, r10344):
- Fix: Acceleration for trains on slopes is not calculated properly [FS#786] (r10317, r10344)
- Fix: Rail could be destroyed when building tunnels (r10306)
2007-06-28 14:11:00 +00:00
rubidium a6c7987a43 (svn r10372) [0.5] -Backport from trunk (r10288, r10290, r10293, r10294, r10295, r10347, r10348):
- Feature: Make the client list window (for network games) stickyable (r10293)
- Fix: Smooth economy did not close primary industries and it allowed increasing of production of industries that should not have rising productions (r10290, r10347, r10348)
- Fix: Flush the output of the dedicated server console (r10295)
- Fix: The "pause" key did not work in the scenario editor (r10294)
- Fix: Age non-front engines too (so when you move engines around in the depot they do not get age 0 when they are much older [FS#202] (r10288)
2007-06-28 13:58:39 +00:00
rubidium 7fff0a71f2 (svn r10280) [0.5] -Backport from trunk (r10109, r10219, r10222, r10230, r10246, r10258):
- Fix: Do not look in every direction for tunnels when building one, one direction is enough (r10258)
- Fix: Take the age of the front vehicle for station rating (r10246)
- Fix: Terraforming wipes out canals. Now you always have to remove the canal before terraforming, instead of "just" removing the canal [FS#594] (r10240)
- Fix: Only 2 trains could crash at one time as collision checking stopped on the first hit. This could technically cause desyncs in network games as the collision hash order is not guaranteed [FS#892] (r10222)
- Fix: Land under foundations was terraform when it shouldn't be terraformed [FS#882, FS#890] (r10219)
- Fix: Some NewGRFs use the same (unused in the "current" climate) sprite IDs. Normally this gives some artefacts, but when one NewGRF expects it to be a sprite and another NewGRF overwrites it with a non-sprite nasty things happen (drawing a non-sprite crashes OTTD) [FS#838] (r10109)
2007-06-22 20:12:09 +00:00
rubidium 141da0127f (svn r10274) [0.5] -Backport from trunk (r9961, r10023, r10028, r10030, r10038, r10147):
- Fix: Some bits were unset when loading old TTD savegames when they shouldn't be unset (r10147)
- Fix: Sprite resulting from '?' substitution was reloaded into the cache entry for SPR_IMG_QUERY instead of the original sprite cache entry. This resulted in unaccounted missing sprite cache memory, and was exacerbated because the original missing sprite was not cached, so it did it again and again and again. Slowdowns and boom (r10038)
- Fix: One could build on (some) slopes when building on slopes was disabled [FS#823] (r10030)
- Fix: When deleting the first engine of a train with multiple engines, only reopen the train window if the player had the original train window open. This fixes 'random' windows opening for multiple players of the same company (r10028)
- Fix: When selling trains, if there were no wagons between multiheaded engines the rear part could be checked despite having already been deleted (10023)
- Fix: Some files were still in iso8859-15 instead of UTF-8 (r9961)
2007-06-22 20:01:02 +00:00
rubidium d2ce2009b5 (svn r9350) [0.5] -Backport from trunk (r9105, r9115, r9117, r9146):
- Fix: disable the ability to make flooding water with the canal build tool. In the scenario editor you can still make both canals and flooding water at height level 0 (r9105)
- Fix: make clear in the tooltips when the canal build tool (in the scenario editor) makes flooding water (r9115)
- Fix: difficulty level button was not selected when opening the difficulty window (r9117)
- Fix: "Train is lost" message is generated incorrectly (r9146)
2007-03-19 20:23:27 +00:00
rubidium c559703312 (svn r9345) [0.5] -Backport from trunk (r9277, r9337, r9338):
- Fix: shared orders got messed up when the 'first' trains got removed in the depot (r9277)
- Fix: assert() when you removed the orders of a shared list while having the shared order vehicle list open (r9337)
- Fix: close the Shared Order Vehicle List if you remove the shared link with only 2 vehicles (r9338)
2007-03-19 19:42:40 +00:00
Darkvater b3b28dced2 (svn r8883) [0.5] -Backport from trunk (r8740, r8793, r8865, r8878):
- GCC warnings for r8738 (r8740)
 - Correct spelling of real french townnames and 'remove' a duplicate (r8793)
 - (NewGRF) Ignore 1 byte action 0s during safety check (r8865)
 - Stricter checks for CmdMoveRailVehicle() parameters (r8878)
2007-02-24 16:46:36 +00:00
peter1138 8e26cfb157 (svn r7473) -Fix (r7269): Pass a cargo type to determine the freight weight
multiplier instead of a vehicle. Fixes incorrect display of total 
train capacity.
2006-12-10 19:00:06 +00:00
glx 5f8f0e4e47 (svn r7459) -Fix: make sure TrainConsistChanged() is called for the first vehicle of a chain after reffiting
because free wagons present in depot can have the same type as the one bought and refitted by autoreplace
2006-12-09 20:14:26 +00:00
peter1138 6172cfbeb3 (svn r7425) -Fix (r1681): With realistic acceleration, guarantee a minimum braking
force is applied. This ensures trains will stop when going down hill.
2006-12-07 18:58:20 +00:00
peter1138 1878d1453d (svn r7421) -Fix (r2475): Changed "kick off" acceleration resulted in only a small amount of power being applied whilst moving off and then double the power at 1 mph. This resulted in a perceived delay before trains moved. Fix this by applying the full power of the engine (or the kick off, whichever is greater). Essay over. 2006-12-07 14:44:26 +00:00
bjarni 256fa07de6 (svn r7389) -Fix: when forcing a vehicle to go to a depot, clear refit orders from current orders (caused refit error popup when not having no orders) 2006-12-05 23:57:04 +00:00
bjarni 4adc6ba4f8 (svn r7386) -Codechange r7385: moved deletion of the vehicle highlight from DeleteVehicle to the sell commands as they are not called as often
Also added a return to the window loop prevent looking at the rest of the windows once the right depot window is found
2006-12-05 22:59:42 +00:00
peter1138 1267bb5968 (svn r7378) -Fix (r2428): Don't update vehicle images when turning a train around.
During this procedure the train is split into parts which can result in 
incorrect images being used.
2006-12-05 20:22:14 +00:00
peter1138 e205c58ddc (svn r7330) -Fix (r7304): Data invalidation doesn't always happen as the local
player, resulting in an empty vehicle purchase list. Specify the player 
as an argument to IsEngineBuildable()
2006-12-03 15:48:21 +00:00
peter1138 039794e83c (svn r7326) -Feature: Add support for gradual (un)loading of vehicles (Maedhros) 2006-12-02 16:56:32 +00:00
Darkvater 04f9944746 (svn r7313) -Codechange: Calling invalidate data on a window will surely warrant a redraw, so call
that after the WE_INVALIDATE_DATA event and remove (some of) the superflouous calls.
2006-12-01 00:09:13 +00:00
peter1138 470c383738 (svn r7269) -Feature: Add freight trains patch option. This option is a multiplier for the weight of cargo on freight trains, to simulate longer heavier trains. The default value of 1 behaves as before. 2006-11-27 23:11:56 +00:00
peter1138 45e7e61aa9 (svn r7268) -Codechange: change rail vehicle cached weight from 16 to 32 bit values to avoid possible overflows. 2006-11-27 21:14:19 +00:00
KUDr f2cda44d2e (svn r7195) -Feature: [FS#297, optional elrails] New patches/vehicles option 'disable electrified railways'.
(original patch by maedhros, ideas: peter1138, Darkvater, Rubidium, Patrick, Eddi|zuHause, ..)
2006-11-17 19:31:44 +00:00
KUDr b2eece5b53 (svn r7003) -Fix: only the appropriate train owner can now see the "Train is lost" message (peter1138) 2006-10-29 13:50:39 +00:00
KUDr c758f7d812 (svn r6800) -Feature change: [train is lost] message is now generated immediately when pathfinder can't find the path. (thanks MeusH, peter1138 and Brianetta for ideas and help). 2006-10-17 16:16:19 +00:00
peter1138 a01ae2bafe (svn r6782) - Fix (r3947): Invalidate depot & vehicle windows when reversing a single engine with ctrl-click. 2006-10-15 20:46:10 +00:00
peter1138 35b059210d (svn r6765) - Fix: Don't add up running cost of articulated engine parts. 2006-10-13 15:15:22 +00:00
peter1138 fd3fd176e5 (svn r6755) - Fix: Pass the newly created vehicle when checking for articulated engines. As this could result in more parts being added than previously counted, we check to see if we need to allocate more vehicles as we add parts. 2006-10-12 15:03:19 +00:00
bjarni 9cf0fa3238 (svn r6728) -Fix r6651: solved issue where moving rail vehicles in a depot could read from a NULL pointer 2006-10-10 17:53:08 +00:00
bjarni ea075f78e0 (svn r6651) -Coding feature: added the windowevent WE_INVALIDATE_DATA
This gives the ability to invalidate some window data and recalculate as needed instead of doing it for each WE_PAINT

   This event is called right away when using InvalidateWindowData(), so it may be a good idea to set a bool or similar in the window
     or similar and then act on that bool in WE_PAINT instead of doing a lot of stuff in WE_INVALIDATE_DATA as it might be called more than once before WE_PAINT is called

   InvalidateWindowData() will not automatically repaint the window, so if you want to repaint it as well, you need to mark it dirty as well.

   Made the depot windows use WE_INVALIDATE_DATA to set when to generate the engine and wagon lists instead of at each redraw
   It makes no sense to regenerate the list when say using the scrollbar if we know that no vehicle have entered or left the list

   NOTE: currently there is a piece of code to generate the list when it's not needed and compare it to the stored list and assert if they mismatch
    This check is somewhat slow and kills the whole idea of WE_INVALIDATE_DATA, so it's a short lived one to verify that InvalidateWindowData() is used everywhere where it's needed
2006-10-05 12:59:28 +00:00
peter1138 cdfac3d7b7 (svn r6649) - Codechange: Show more correct capacity of articulated wagons in the train purchase list. 2006-10-05 11:26:59 +00:00
bjarni f8f0bd4943 (svn r6637) -Codechange: merged all (vehicle type)EnterDepot into VehicleEnterDepot()
This revealed duplicated code like aircraft lists got invalidated twice
   Moved invalidation of the vehicle detail window to VehicleServiceInDepot() as it should always be updated when serviced
2006-10-04 12:01:59 +00:00
bjarni ea63050d5f (svn r6624) -Feature: added ability to add refit commands to vehicle orders (can only be done in goto depot orders)
Example: make a train transport iron ore from A to B, then it visits a depot and refits to steel
     It then transport steel back to A or near A if there is a factory and then it visits another depot to refit to iron ore again

   This is controlled in the orders. If a goto depot order is lightlighted, then "Unload" changes to "Refit"
   Control click "Refit" removes the refit part of the order (as the tooltip says)
   The player will still pay the normal refit costs

   Known issues:
      If a vehicle is not in a depot, then the refit window will fail to tell refitted cargo capacity
      Refit costs in the refit window can sometimes print 0 when it should not because the refit calculation is unaware that the vehicle will be refitted in between

   Warning: autoreplace got a protection against replacing something so you get a new cargo type, but it can fail here. In the iron ore/steel example, it can see that
      the vehicle carries iron ore and the new one can be refitted to iron ore, then it will replace. It will not check to see that it's valid for steel as well.
      This is something to look into in the future
2006-10-03 14:52:39 +00:00
peter1138 e383584988 (svn r6618) - After refitting a train, update its cached variables as they may change. 2006-10-02 22:10:04 +00:00
peter1138 653e7fa548 (svn r6532) - Feature: Add support for NewGRF sound effects. Currently sound priority isn't supported. 2006-09-27 18:17:01 +00:00
bjarni 5dbfb5c272 (svn r6524) -Code cleanup r6515: cleaned up the command to start/stop all vehicles in a depot.
IsWholeTrainInDepot() is removed as CheckTrainInDepot() could be used instead
  Cleaned up the check to see if a vehicle is valid for start/stop
2006-09-27 12:17:33 +00:00
glx bae85177d4 (svn r6496) -Codechange: removed direct map access in train_cmd.c (Rubidium) 2006-09-22 22:15:34 +00:00
bjarni 00a08601c9 (svn r6424) -Codechange: [autoreplace] removed a loop though all vehicles from each time the window is redrawn
To do this, the player struct contains an array, that contains the count of each engine type that the player owns
   Those arrays are updated each time a vehicle is build or deleted and is calculated on load (it's not saved)
   It's possible to access the arrays outside of the autoreplace GUI, so feel free to read from them in other patches as well
2006-09-08 10:47:39 +00:00
Darkvater 80814dbb1d (svn r6406) -Codechange: Rename TileOffsByDir to TileOffsByDiagDir because it accepts
DiagDirections, and add TileOffsByDir that handles Directions.
-Codechange: Make the treeloop use TileOffsByDir().
2006-09-05 23:21:41 +00:00
glx ec6189081d (svn r6395) -Fix: when converting a depot from/to elrail, update the power of trains that are in it 2006-09-05 16:40:23 +00:00
rubidium 63687763e9 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
-Cleanup: whitespace alignment of a few tables.
2006-09-04 20:40:33 +00:00
Darkvater b7f36808ac (svn r6378) -Codechange: Rename VLW_FLAGS to VLW_MASK as it is a mask 2006-09-04 15:16:58 +00:00
bjarni 1a0476535d (svn r6376) -Codechange: [vehicle refit] moved all refit cost calculations into GetRefitCost()
Now it's possible to tell refit costs for an EngineID without actually having build a vehicle
2006-09-04 09:07:52 +00:00
bjarni 6baf488839 (svn r6356) -Fix: FS#263 planes come out of hangar and drive back into hangar
Now all vehicles are serviced when it's time for service and they are in a depot
   This will avoid the goto depot order from ever showing up when in a depot
2006-09-03 11:49:38 +00:00
tron 1c21c645ae (svn r6353) -Codechange: Make DestinationID a typedef of uin16, which is as large as any type of destinataion (StationID, DepotID, WaypointID) it can hold
DestinationID being a union of these types is just hassle without benefit and cannot be handled correctly everywhere because of local lack of information
2006-09-03 08:25:27 +00:00
bjarni 302772883c (svn r6352) -Fix: FS#322 Send to depot bug
now vehicles can't be sent to a depot when they are already inside a depot
   before they would remember the order and try to turn around when leaving the depot
2006-09-02 22:47:45 +00:00
bjarni 61e2fa3cd2 (svn r6304) -Codechange r6295: Use !! instead of (bool) in commands to send vehicles to depots 2006-09-02 09:35:03 +00:00
bjarni 26c10adbfc (svn r6295) -Feature: using goto depot with a different control selection will now alter the service/stopping in depot flag instead of cancelling the goto depot order 2006-09-01 12:37:03 +00:00
bjarni d7e1d08d53 (svn r6291) -Feature: Vehicle lists from the station window now also got the goto depot button
-Codechange: unified the code for mass goto depot to avoid duplicated code
-Fix: Vehicles already on the way to depots will not be cancelled by mass goto depot (made it really hard to send all vehicles at once)
2006-09-01 10:24:15 +00:00
bjarni 744840c3da (svn r6246) -Feature: added the many times requested "send all vehicle to depot" button
it's located in the vehicle list screen and does the same as in the shared orders window (send all vehicles in list to a depot)
	it will still not inform the player if a vehicle failed to find a depot, so don't take for granted that all of them go
2006-08-30 21:39:01 +00:00
bjarni 15f9208302 (svn r6229) -Feature: Shared order lists now got a "goto depot" button
this will try to send all vehicles in the list to depots/hangars
	currently if one fails to find a depot, it will not tell the player
2006-08-29 23:39:57 +00:00
rubidium 27cee58ab8 (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc. 2006-08-28 18:53:03 +00:00