summaryrefslogtreecommitdiff
path: root/industry_cmd.c
AgeCommit message (Collapse)Author
2005-08-01(svn r2780) Remove some more unused strings and make the use of a few ↵tron
strings more explicit
2005-07-24(svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic ↵celestar
numbers by enums. There remains work in gfx.c to move the "transparency" and "recolor" bits around to make space for more sprites. However, 2800 additional sprites can now be loaded. There also remains cleanup and Doxygen work on many of the header files.
2005-07-24(svn r2701) Insert Id tags into all source filestron
2005-07-22(svn r2673) Include functions.h directly, not globally via openttd.htron
2005-07-21(svn r2669) Shuffle some more stuff around to reduce dependenciestron
2005-07-21(svn r2660) Get rid of some more shifting/anding/castingtron
2005-07-20(svn r2658) -Codechange: Use MAKE_TRANSPARENT to display a transparented spritecelestar
2005-07-20(svn r2650) Convert many explicit shifts+ands to extract bits to invocations ↵tron
of GB - should be a bit nicer to read
2005-07-19(svn r2643) Get rid of some unnecessary caststron
2005-07-16(svn r2595) -Codechange: Introduced "IsSteepTileh" to find whether a tile is ↵celestar
steep (i.e. spans two height levels) and use it throughout the code. -Codechange: Add CanBuildDepotByTileh to find if a tile is suitable to build a depot on it. Wraps some bitmagic which seems quite unreadable at first glance
2005-07-15(svn r2582) Fix: Prevent generating unrealistically many Oil refineries on ↵ludde
large maps. They are always placed next to the borderline, so the perimeter is used instead of area to scale the number of those industries.
2005-07-15(svn r2580) Change: Added {INDUSTRY} command for printing industry names ↵ludde
instead of the old {TOWN} {STRING} way. - The formatting of the industry name can be controlled with the string STR_INDUSTRY_FORMAT. Change: Changed several occurences of {STRING1} into {TOWN} to get rid of townnametype being used directly.
2005-07-15(svn r2570) Fix: Removed some code that had no effect.ludde
2005-07-13(svn r2560) Fix: various minor code changes.ludde
Added RandomTile/RandomTileSeed functions to generate a random tile. Changed landscape routines so they don't assume that the Y map side is a power of two. (support for this is not complete, though) Changed some frequently used map macros to not compute the values each time. Silence some warnings on MSVC.
2005-07-13(svn r2558) Change the internal map format from 7 arrays to one array of ↵tron
structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
2005-06-25(svn r2487) Replace TILE_XY by TileXY/TileDiffXYtron
2005-06-25(svn r2486) Turn TILE_FROM_XY into an inline function and rename it to ↵tron
TileVirtXY
2005-06-24(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"tron
2005-06-02(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.Darkvater
2005-05-30(svn r2387) - CodeChange: made the saveload code more readable and also ↵Darkvater
removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big. - Fix: also fix an unnoticed error in SlSaveLoadConv() due to wrong types.
2005-05-13(svn r2304) - Fix (regression): excuse the Lumber mill from the list of ↵Darkvater
raw-industries build-restriction, as it can be built always, patch-setting, or no patch-setting.
2005-05-11(svn r2290) - CodeChange: protect the next batch of commands. This brings us ↵Darkvater
to a total of 61, which is 53% :) - CodeChange: To correctly accept engine-prototypes, the best-player checking has been moved to its own function, I hope it functions the same as before. - CodeChange: Added symbolic types of PlayerID, OrderID and EngineID. For engines also added GetEngine() and IsEngineIndex(), similar to the other such functions. - CodeChange: To correctly build industries, some tables have been moved to build_industry.h. The only way to find out currently if an industry is valid in a climate is by looping all industries and checking if it matches. Also to comply with the patch setting build_rawmaterial_industries, it is assumed that these industries do not accept any cargo of any type. This can and probably should changed in the future to some flag in their struct. Also use _opt_ptr instead of _opt. - CodeChange: implemented the HQ checking code inspired by MarkR2 in "[ 1190944 ] Many commands not checked for security". Unfortunately it is impossible to prevent only deleting a HQ by a modified client atm. - CodeChange: For insert order and modify order their parameters are implicitely truncated to 8 bits, instead of the 16 bits said in the comments.
2005-03-29(svn r2107) - Codechange: Cleanup (well, mostly tidyup) ↵pasky
ExtChangeIndustryProduction(). These randoms are strange.
2005-03-27(svn r2090) CheckNewIndustry_Oilwell() -> CheckNewIndustry_Oil() since it ↵pasky
was concerning oil rigs and oil rafineries, but specifically NOT oil wells. ;-) Documented that.
2005-02-14(svn r1877) Forgot to remove two now unused variablestron
2005-02-14(svn r1876) Make placement of oil rigs and refineries map size agnostictron
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-07(svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more ↵tron
explicit types as parameters
2005-02-06(svn r1824) -Codechange: made ChangeIndustryProduction a bit more readabletruelight
2005-02-04(svn r1791) Remove the remnants of CMD_DESTROY_INDUSTRY, which was removed a ↵tron
long time ago
2005-02-02(svn r1774) -Fix: fixed an other possible crash related to previous committruelight
2005-02-02(svn r1773) -Fix: [ 1114950 ] Game crashed sometimes when there were no ↵truelight
industries in the map
2005-02-02(svn r1771) -Add: Industries are now dynamic (up to 64k industries). Generating truelight
1kx1k maps should now be much faster, and give more than just oil-stuff ;)
2005-01-31(svn r1751) - Feature: New PathFinder (NPF).matthijs
- Supports trains, road vehicles and ships. - Uses A* pathfinding (same codebase as the new ai). - Currently unlimited search depth, so might perform badly on large maps/networks (especially ships). - Will always find a route if there is one. - Allows custom penalties for obstacles to be set in openttd.cfg (npf_ values). - With NPF enabled, ships can have orders that are very far apart. Be careful, this will break (ships get lost) when the old pathfinder is used again. - Feature: Disabling 90 degree turns for trains and ships. - Requires NPF to be enabled. - Ships and trains can no longer make weird 90 degree turns on tile borders. - Codechange: Removed table/directions.h. - table/directions.h contained ugly static tables but was included more than once. The tables, along with a few new ones are in npf.[ch] now. Better suggestions for a location? - Fix: Binary heap in queue.c did not allocate enough space, resulting in a segfault. - Codechange: Rewritten FindFirstBit2x64, added KillFirstBit2x64. - Codechange: Introduced constant INVALID_TILE, to replace the usage of 0 as an invalid tile. Also replaces TILE_WRAPPED. - Codechange: Moved TileAddWrap() to map.[ch] - Add TileIndexDiffCByDir(), TileIndexDiffCByDir(). - Codechange: Moved IsTrainStationTile() to station.h - Add: IsRoadStationTile() and GetRoadStationDir().
2005-01-31(svn r1749) Move the functions which calculate distances to map.[ch] and ↵tron
give the more meaningful names
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-28(svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D()tron
These scale a number relative to the map size/circumference. Use them to scale the amount of map objects. Of course at the moment they return just the input, because there are no bigger/smaller maps yet.
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-22(svn r1594) Convert all undefined parameter lists to (void) and add the ↵tron
appropriate warning flags in the Makefile
2005-01-18(svn r1560) Introduce SetTileType() and SetTileHeight()tron
Replace direct references to _map_type_and_height with these
2005-01-17(svn r1549) Clean up some functions:tron
uint tile -> TileIndex tile if () cascade -> switch ()
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 r1520) Trim 134 (!) lines with trailing whitespace ):tron
2005-01-14(svn r1504) enummed town ratings (Jango)celestar
2005-01-09(svn r1443) Added feature that users are able to place multiple accepting ↵miham
industies nearby in the editor mode if the appropriate patches are set
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-04(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for ↵darkvater
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.