summaryrefslogtreecommitdiff
path: root/ai.c
AgeCommit message (Collapse)Author
2005-03-25(svn r2066) - Fix: [ 1164248 ] game crash while AI builds bridge. Also ↵Darkvater
protect bridge building against invalid bridges and some safeguards when drawing.
2005-02-07(svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more ↵tron
explicit types as parameters
2005-02-06(svn r1834) - Fix: NPF does not check the owner of its target, busses try to ↵matthijs
enter other players' depots. TODO - Add: asserts to find the v->u.rail.track == 0 problem. - Add: IsValidDepot(), IsValidTown(), IsValidSign(), IsValidVehicle(), IsValidStation() - Add: GetTileOwner(), IsTileOwner() - Codechange: Replaced IsShipDepotTile(), IsTrainDepotTile(), IsRoadDepotTile() by IsTileDepotType(). - Codechange: typedeffed the MAP_OWNERS as Owner. Should be used as variable type. - Codechange: Replaced a few uint by TileIndex.
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-01-31(svn r1749) Move the functions which calculate distances to map.[ch] and ↵tron
give the more meaningful names
2005-01-30(svn r1728) - Fix: now a player can only build a road vehicle in depots he ↵bjarni
owns (hacked client protection)
2005-01-30(svn r1727) - Fix: now CmdBuildRailVehicle() behaves correctly if DC_EXEC is setbjarni
this commit alters ai.c a little to get rid of the workaround from r1725 so AI players could still build locomotives
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 r1720) - Fix: signed/unsigned warnings. Tile which is ↵darkvater
incremented/decremented every time until suitable ground is found is compared to the direction it is going in. If this wraps, return error. For this treat the tile itself as a TileIndexDiff
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-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 r1642) -Fix: solve AI related order-problemtruelight
2005-01-22(svn r1594) Convert all undefined parameter lists to (void) and add the ↵tron
appropriate warning flags in the Makefile
2005-01-16(svn r1544) -Fix: SwapOrder did not use AssignOrder, which caused the ↵truelight
saveroutine to crash from time to time -Codechange: added const before 'Order *' where possible
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 r1451) Fix some of the signed/unsigned comparison warningstron
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-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 r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDifftron
2005-01-05(svn r1386) Move TileIndexDiff to map.htron
Move _tileoffs_by_dir to map.[ch] and encapsulate it in TileOffsByDir()
2004-12-30(svn r1301) -Codechange: _industries finally has FOR_ALL_INDUSTRIES tootruelight
2004-12-15(svn r1117) Move map arrays and some related macros into their own files ↵tron
map.c and map.h
2004-12-08(svn r979) Allow more realistically sized catchment areasCelestar
2004-12-05(svn r960) -Fix: forgotten conversion of orders for the AI (Tron)darkvater
2004-12-05(svn r955) Replace uint16 for orders with struct Ordertron
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-04(svn r923) Forgot s/rail_vehinfo/RailVehInfo/tron
2004-12-03(svn r920) Replace vehicle info macros with inline functions and add asserts ↵tron
to check limits
2004-12-03(svn r907) Sprinkle holy ANSI water:tron
- "inline" must before the return type (and after "static") - Initialise all struct members, not just some of them - Remove (one) spurious semicolon
2004-11-19(svn r677) -newgrf: Fix some custom electric trains appearing in maglev ↵darkvater
depots (pasky).
2004-11-14(svn r607) -Patch: [ 985102 ] static cleanuptron
Thanks to lvoge
2004-09-10(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!truelight
2004-09-10(svn r193) -Fix: [OldAI] If service-interval is in %, it works correct now.truelight
2004-09-05(svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)truelight
-Fix: some minor fixes around GetTileTrackStatus (blathijs)
2004-08-17(svn r77) -Fix: [1010788] AI service interval bug (tnx truesatan)truelight
-Add: AI overrides service interval to 180 days -Fix: AI hanged when all vehicles were disabled in Patch menu
2004-08-11(svn r22) Add: Competitors menu under patchestruelight
Fix: I forgot to delete a local var from ai.c
2004-08-11(svn r21) Remove: PE_BYTE (bit-bools) in favour of PE_BOOLtruelight
2004-08-09(svn r1) Import of revision 975 of old (crashed) SVNtruelight