summaryrefslogtreecommitdiff
path: root/vehicle.c
AgeCommit message (Collapse)Author
2005-03-19(svn r2024) -Fix: [autoreplace] reverted all changes involving ↵bjarni
v->set_for_replacement as they caused desyncs. The bad sideeffect of this is that now no vehicle will automatically go to a depot anymore just because it is set to be autoreplaced. We will have to find a better way to solve this problem. Revisions reverted: 1640, 1707, 1709, 1710, 1712(but not the cheat prevention in this one)
2005-03-09(svn r1979) Const correctnesstron
2005-02-22(svn r1898) Remove some unused macros from macros.h and move some others to ↵tron
more appropriate headers
2005-02-14(svn r1875) Effect vehicle overhaul: enumerate sprites, descriptive names ↵tron
for functions and miscellaneous improvements
2005-02-13(svn r1869) Fix some bugs in the bulldozer movement implementation.tron
Now they move in a sane pattern.
2005-02-13(svn r1868) Improve readability of the bulldozer movement codetron
2005-02-12(svn r1863) Give the effect vehicle type enums more descriptive names and ↵tron
use the enum as parameter type for CreateEffectVehicle*() -Fix: [1116619] Generate the correct smoke type for diesel trains
2005-02-10(svn r1853) Move spritecache function declarations into a header of their ↵tron
own and use SpriteID as parameter type where appropriate
2005-02-06(svn r1832) Next byte -> char iteration: custom namestron
2005-02-06(svn r1817) -Codechange: Moved depot-functions to depot.ctruelight
-Codechange: Added wrappers around depot-access (GetDepot no exists) -Codechange: Made depot-functions a bit more logic (no longer GetDepotByTile crashes your game when you request it on a non-depot tile) -Add: made depots dynamic (yes, 64k depots are possible now)
2005-02-04(svn r1786) -Fix: unitnumber is increased to 16bit, so now you can have up ↵truelight
to 5000 trains in one game (instead of the 240 which was the current value). Default max allowed vehicles per type is changed: Trains: 500 (old 80) Road: 500 (old 80) Ships: 200 (old 40) Aicraft: 300 (old 50) (Tnx to Celestar and Darkvater for checking the patch)
2005-02-04(svn r1783) -Add: Dynamic vehicles (now up to 64k of vehicles)truelight
2005-02-02(svn r1770) -Fix: Hopefully last pieces of code that are containing a station-idtruelight
(and should be an uint16, not uint8)
2005-01-30(svn r1741) - Fix: added IsVehicleIndex() so it's possible to protect ↵bjarni
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-29(svn r1721) -Feature: It is now possible to build multiple road stations (up ↵celestar
to 8) on a single station. Thanks to: Truelight for the saveload code, Darkvater and Hackykid for network testing and Tron for proof-reading 1500 lines of diff.
2005-01-29(svn r1718) Use the enum TileType as parameter/return type for ↵tron
[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(svn r1713) Split off several functions which query/set information about a ↵tron
single tile from map.h and put them into a seperate file tile.h
2005-01-27(svn r1696) Use GetTileSlope() instead of FindLandscapeHeightByTile() where ↵tron
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-26(svn r1690) - Fix: [autoreplace] Cheaters can no longer exploit autoreplace ↵bjarni
to get vehicles, that's not invented yet - Fix: [autoreplace] Fixed a stupid bug introduced in r1687, that made a crash if anybody tried to autoreplace anything but an aircraft
2005-01-26(svn r1687) - Feature: [autoreplace] server now checks for ↵bjarni
plane<->helicopter replacement and reject replacement if needed
2005-01-25(svn r1676) Increase the size of TileIndex and TileIndexDiff to 32bits and ↵tron
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-24(svn r1640) fix: now helicopters will use a hangar in schedule to be ↵bjarni
replaced in, even if they are only set to service there. Since helicopters are serviced at helipads, they will only go there if they needs to be replaced or renewed.
2005-01-23(svn r1629) added a counter to tell how many engines you have of each type ↵bjarni
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(svn r1612) -Fix: made sure that ->next pointers are set to NULLtruelight
2005-01-23(svn r1610) Remove trailing whitespace (last time ever, i hope)tron
2005-01-22(svn r1594) Convert all undefined parameter lists to (void) and add the ↵tron
appropriate warning flags in the Makefile
2005-01-21(svn r1583) -Fix: You should no longer be able to delete bridges on any type ↵darkvater
of underground when there is a vehicle on it
2005-01-19(svn r1569) -Fix: signed/unsigned mismatchdarkvater
2005-01-19(svn r1568) made an enum of train subtypes to make the code more readablebjarni
2005-01-19(svn r1564) ISO C90 forbids mixed declarations and code (bad bjarni, no cookie)tron
2005-01-19(svn r1563) fix: autoreplaced trains now sets wagon override properlybjarni
2005-01-18(svn r1561) Fix: autoreplacing a singleheaded engine into a dualheaded ↵bjarni
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(svn r1559) Use IsTileType() instead of bit shifting and comparisonstron
2005-01-16(svn r1538) -Feature: [988816] Disable servicing when breakdowns set to none ↵darkvater
(jaguar7)
2005-01-16(svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn ↵tron
them into inline functions and add some asserts
2005-01-15(svn r1525) -Codechange: rewrote the _order_array, now it can be made dynamic.truelight
-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-09(svn r1448) -Fix: The current_order of a vehicle is now correctly saved (caused truelight
massive desyncs) Warning: savegames which are made with the nightly of 08-01-2005 will NO LONGER work!!
2005-01-08(svn r1429) Change: bumped savegame to revision 5.truelight
- Now orders are bigger - Now _map2 is official 16 bits
2005-01-08(svn r1427) fixed issue where the wrong sprite could be used if ↵bjarni
autoreplacing between single and multiheaded trains
2005-01-08(svn r1426) -Codechange: cleaned up the reference code in the saveload routinestruelight
-Codechange: removed next_in_chain_old, and saved ->next for Vehicles (and bumped savegame revision for that to version 4.4) -Codechange: Added _sl.full_version, which has both major and minor version
2005-01-08(svn r1421) improved autoreplace multiheaded trains. It now remembers the ↵bjarni
current heading for an engine instead of turning all of them like the first one and the last the other way
2005-01-08(svn r1419) fixed issue where autoreplacing dualheaded trains turned the ↵bjarni
last engine the wrong way
2005-01-07(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn ↵tron
the latter into inline functions names Tile[XY]
2005-01-07(svn r1412) -Feature/Fix: Aircraft refit options have been restricted to "sane"celestar
values. -Feature: aircraft can now be refitted "mail-only" -Feature: Passengers aircraft now ignore the amount of mail for "full load any" options
2005-01-07(svn r1410) Replaced all occurences of 'passanger' by 'passenger' in the codecelestar
2005-01-06(svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns ↵truelight
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(svn r1402) Trim trailing whitespacetron
2005-01-05(svn r1393) fix [ 1096026 ]. Autorenew trains should now hopefully work like ↵bjarni
it did before autoreplace was added DEREF_ENGINE is now used in autoreplace
2005-01-04(svn r1378) Fix: train engines are now only replaced if the engine is really ↵bjarni
set to be replaced and they are replaced to the type that engine type is set to be replaced to (instead of whtat the first engine in the train is set to)
2005-01-04(svn r1376) fixed an issue where a modified client could try to replace a ↵bjarni
vehicle to an invalid engine ID and crash the server. Now the server just rejects the request. Also added a check for vehicle ownership, so you should not be able to replace other player's vehicles