Commit Graph

273 Commits (1889ebff853f02e8b71dc6de06d9de73f00a1620)

Author SHA1 Message Date
belugas 7c50416d64 (svn r11977) -Fix(r11976): not a typo, not a bug. Just a removal that should have been done.
Would help to compile first...
17 years ago
belugas e918b8d31b (svn r11976) -Fix: It seems that industries using results 0D/0E on callback cb29/35 were a bit too eager to close down. 17 years ago
peter1138 b5534e42a0 (svn r11952) -Fix (r11926): Prevent industries from being built on rivers, unless they require water. 17 years ago
rubidium 8b90809718 (svn r11925) -Fix (r122, r9867): loading old, pre savegame version 2, savegames. 17 years ago
frosch 9a9a1dcb6c (svn r11876) -Fix: Start industry tile animation also for overridden industry tiles. (Will only apply to new games or newly build industries.) 17 years ago
rubidium 736640fd87 (svn r11866) -Codechange: swap OFB_* and OF_* so it conceptually in sync with other cases of *B_* vs *_* like VETSB_* and VETS_*. 17 years ago
rubidium 90acd52f22 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h. 17 years ago
belugas 1bfe4e0e02 (svn r11798) -Codechange: add comments and give a more representative function's name 17 years ago
rubidium 0365c1f33b (svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114). 17 years ago
rubidium 285a4a106f (svn r11788) -Fix (11787): makedepend doesn't mark delete files as changed... 17 years ago
belugas 578390ada7 (svn r11766) -Codechange: Last fine tunings on smooth economy, by Sirkoz. 17 years ago
rubidium 445a733eb6 (svn r11719) -Codechange: split sound.h in a header with types and one with functions. 17 years ago
glx 40b5641eb4 (svn r11716) -Fix [FS#1561]: don't put more than one Random() in function calls because parameter evaluation order is not guaranteed in the c++ standard (can lead to desyncs) 17 years ago
rubidium 722613f7f3 (svn r11706) -Codechange: split vehicle.h and remove another bunch of useless includes. 17 years ago
rubidium db73addb43 (svn r11702) -Codechange: move all date related stuff to date*. 17 years ago
rubidium f82aeb82c5 (svn r11701) -Codechange: removal unnecessary inclusions of map.h (and split map.h). 17 years ago
rubidium 81bf9f8503 (svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h' 17 years ago
rubidium 3074bca136 (svn r11680) -Codechange: refactor more out of openttd.h and functions.h. 17 years ago
rubidium 766551b0bc (svn r11677) -Codechange: move price and command related types/functions to their respective places. 17 years ago
rubidium 8427b8bad2 (svn r11675) -Codechange: split the string types from the string functions. 17 years ago
rubidium be923601bf (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h 17 years ago
glx 4320447aef (svn r11615) -Fix (r11609): temperate banks can only be built in towns (over a house) 17 years ago
rubidium a510606144 (svn r11609) -Fix [FS#1524]: wrong error messages were shown when trying to build some industries in the scenario editor. 17 years ago
glx 7e7606b0d3 (svn r11590) -Fix (r11193): IsSlopeRefused() result was half wrong 17 years ago
belugas 4f5ae3b66f (svn r11545) -Revert(r11543): The result is not what was expected. Looks like more work might be needed 17 years ago
belugas aeb90dfab4 (svn r11543) -Codechange: Give a more adequate message when trying to place an industry required to be built over a house on any other type of tiles.
In reference to FS#1492, and other "bugs" like that one
17 years ago
belugas b98847e489 (svn r11534) -Feature(newgrf): Implement property 23h for Industries.
This will add a cost to the removal of an industry using the cheat magic bulldozer.
Note that the removal of regular or newgrf industries without specified removal cost will have no cost applied to.
This is a difference from original spec, where a default base cost is added.
17 years ago
belugas a22bdeb8e3 (svn r11532) -Feature[newgrf]: Add decrement(0x0D) / increment(0x0E) production operations from result of production callback cb29/35.
Only var 0x93 will be affected by these operations
17 years ago
maedhros 24a5dd3ca2 (svn r11528) -Fix (r11500): With smooth economy enabled, industries that should only decrease production would always increase it when more than 60% was transported. 17 years ago
skidd13 f56579e0d9 (svn r11526) -Codechange: Rename the function delta fitting to the naming style 17 years ago
skidd13 e36dba227b (svn r11523) -Codechange: Move the CHANCE macros to core/random_func.cpp cause they depend on Random()
-Codechange: Convert the CHANCE macros to functions and rename them fitting to the naming style
17 years ago
rubidium 7f72e5573a (svn r11504) -Fix [FS#1467]: removing docks/ship depots could result in non-canal water where canals should have been build. 17 years ago
glx b38d2e8dbb (svn r11502) -Fix (r11144): don't do standard production change if callbacks 29/35 failed
-Fix (r11144): disable smooth economy for industries using callbacks 29/35
17 years ago
belugas 0ed5570eb4 (svn r11500) -Codechange: Smooth economy fine-tuning, making industries more responsive. Patch by Sirkoz. 17 years ago
glx 74cf54910a (svn r11499) -Fix (r11144): mul/div factor were wrong (off by two) 17 years ago
skidd13 c0a2c0c23e (svn r11481) -Codechange: Rename the HASBIT function to fit with the naming style 17 years ago
skidd13 98f66552be (svn r11475) -Codechange: rename clamp and clampu to Clamp and ClampU to fit with the coding style 17 years ago
rubidium fbd234d274 (svn r11442) -Feature: make news messages related to the industry (production) changes better configurable; you can now disable news messages popping up for industries you are not servicing. Patch by Alberth. 17 years ago
rubidium 2c000f1546 (svn r11420) -Fix [FS#1006]: industry closure news not properly shown when the news item pops up after the industry has been removed from the map. 17 years ago
rubidium 02a6debc11 (svn r11412) -Fix (r11403): animation was not turned on properly.
-Fix (r11410): wrong assumption about random reseeds made the whole thing reseed way too often, making the animation look very ugly.
17 years ago
rubidium c1cf9f3396 (svn r11410) -Codechange: implement random triggers for industries. 17 years ago
rubidium e463f5687d (svn r11403) -Fix: NewIndustries GRF assume that tiles are already animated during construction. 17 years ago
glx df35372b9b (svn r11402) -Fix [FS#1382]: incorrect handling of industry behaviour 'must be in town with population large than 1200' 17 years ago
belugas f26a591e6c (svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
-Codechange: Wrap all transparency settings in accessors, hiding the implementation
-Change: Clicking "transparent building" menu will toggle Houses And Trees only.  The other options can be used in the transparency gui.
Initial patch by Smatz (FS#1349), with some rework by BigBB and your humble servant.
17 years ago
rubidium c871dc1dd5 (svn r11373) -Fix [FS#1398]: do not even think about building disabled industries. 17 years ago
rubidium 0b7de36eb2 (svn r11371) -Fix [FS#1396]: the industry protection only kicked in when it should not kick in. 17 years ago
glx 3d150b6230 (svn r11356) -Fix (r11305): funding industries in MP game was causing desync 17 years ago
rubidium 4e822be109 (svn r11349) -Fix [FS#1372]: crash when moving "invalid" cargo to a station. 17 years ago
glx f642c03d28 (svn r11305) -Codechange: randomise layout when building an industry ingame 17 years ago
rubidium 8342c18fb5 (svn r11303) -Fix: EnsureNoVehicle and EnsureNoVehicleOnGround were both used to check whether there was no vehicle on the ground, except that the former didn't take care of aircraft shadows. So now we only use EnsureNoVehicleOnGround. 17 years ago
glx 3b08339a10 (svn r11302) -Fix (r9520): typo 17 years ago
glx b0e5a3be63 (svn r11301) -Fix: water check when building industries didn't work 17 years ago
glx f6907db708 (svn r11293) -Fix: newgrf defined industry news messages use TTD format for args, which is not the same as our. So we must detect those strings and pass them the right params 17 years ago
glx 34f8fd2d2b (svn r11285) -Fix: 'site unsuitable' was always shown instead specified message when trying to build industry ingame (Csaboka) 17 years ago
rubidium 3bcfe14cd1 (svn r11276) -Codechange: be more consistent with naming of some accessors.
-Fix: make sure canals are never owned by water. Based on a patch by boekabart.
17 years ago
belugas 1280c7636d (svn r11268) -Fix[FS#1336]: Call IsSlopeRefused whenever it is required. Looks like there was one spot missing. Thanks frosch 17 years ago
glx d796519e49 (svn r11207) -Fix [FS#1301]: don't use smooth_economy for industries using production callbacks as they may have no production for more than a month 17 years ago
belugas 23eed48a92 (svn r11197) -Fix: It is not useful to reset the override of an entity every time a new grf file is been submitted.
Since newhouses showed the way to newindustries(meaning I copied/adapted a lot of code and processes from it), the behaviour was there for newhouses too.
17 years ago
rubidium 8c25b4575c (svn r11194) -Fix: industries with not all tiles custom slope checked (but at least one) would be build on wrongly sloped tiles. 17 years ago
rubidium 5093d8b1cd (svn r11193) -Fix: be more compliant with the specifications of callback #2F (and undocumented side effects in TTDP in corner cases). 17 years ago
rubidium 69488b521c (svn r11186) -Fix: only fill the accepted cargo fields once, not multiple times. 17 years ago
rubidium 09182386fb (svn r11185) -Codechange: prepare some more code for the introduction of NewIndustries. Patch by Belugas. 17 years ago
glx cc6ac7f539 (svn r11181) -Codechange: add support for newgrf callback 14A (Belugas) 17 years ago
glx 52f10b2fbd (svn r11177) -Codechange: add support for newgrf callbacks 14B and 14C 17 years ago
glx 18de82b000 (svn r11176) -Revert (r9867): as it is needed for newgrf callbacks 14B and 14C 17 years ago
rubidium e582e6364c (svn r11171) -Fix [FS#1257]: disable autoslope for automatically changed stuff (like towns and industries) and enable it in the scenario editor. Patch by frosch. 17 years ago
rubidium 03191bba4b (svn r11168) -Fix [FS#1256]: assert on terraforming of industries. Patch by frosch. 17 years ago
belugas bd9d8c08ed (svn r11160) -Fix: A gfx of 0xFF does not count when it's time to establish the size of the industry. 17 years ago
glx b1fa49d3fa (svn r11144) -Codechange: add support for newgrf callbacks 29 and 35 17 years ago
glx af3f96957f (svn r11142) -Codechange: prepare industry production change code for newgrf callbacks 29 and 35 17 years ago
rubidium 81555c732d (svn r11139) -Codechange: add support for persistent storage for NewGRFs. 17 years ago
belugas a0946e5d7e (svn r11137) -Feature: [NewGRF] Add support for bit 17 of property 1A for Industries. This bit enables the protection of the last instance of an industry type once raise. 17 years ago
rubidium 3055d42fc4 (svn r11107) -Feature: some tool so one can still build tunnels under rails (and other structures) when the owner of the structure built it on foundations and if you have enough "empty" space ofcourse. One could use the tool for some other construction needs too. Patch by frosch. 17 years ago
rubidium 556035f448 (svn r11102) -Codechange: remove some pointless addition+substractions. Patch by frosch. 17 years ago
belugas 71a23846d3 (svn r11050) -Codechange: Use the translated gfx, not the original one. 17 years ago
rubidium cadf412dcd (svn r11041) -Fix (r10460) [FS#1195]: the industry's owner was saved twice instead of the owner and the founder. Patch by frosch. 17 years ago
rubidium f4482907da (svn r11005) -Codechange: move the tiletype specific terraforming checks to the functions for those tile types.
-Codechange: barren the rail grounds on terraforming.
17 years ago
rubidium 759255df12 (svn r10991) -Codechange: add documentation, enumification and some code simplifications to the terraforming code. Patch by frosch. 17 years ago
belugas 182283a67c (svn r10980) -Fix [FS#1158] : This will hopefully fix the case of an assert that happens when an industry uses a special gfx index (tile spec 0xFF). This 0xFF is the sentinel of a special check done for oil rigs, where water need to be around, but no tile will be constructed on it.
Problem is that the upper limit of gfx tiles is currently at 175.  So, of course the system will assert with 255 ;)
17 years ago
belugas 40d4d2f2ca (svn r10972) -Codechange: Implement the counterpart(GetTranslatedIndustryTileID) of getindustileid of TTDPatch. This allows to ensure that the ID of a tile (taken out of the map or not) is still a valid one regarding the possible override it may have been flagged to.
It is not the strict same thing, but is what we need regarding the slightly different approach we took for newindustries.
17 years ago
belugas 69f9545a20 (svn r10963) -Revert(10700): Although the idea was good, it was more prone of errors than usefull.
So now, it will be better to jump to the overriden tile when it is been marked as an override
17 years ago
belugas 339579e22a (svn r10962) -Codechange: protect yourself against an illicit substitution 17 years ago
belugas f48e05ec73 (svn r10903) -Feature: [NewGRF] Add support for variable 44 of Variational Action 2 for Industries 17 years ago
rubidium 341281a7d4 (svn r10813) -Fix (r10799): some destructors were performing too much during the pool cleanups, which could cause crashes as already removed pool items could then be dereferenced by other destructors. 17 years ago
rubidium 655b2048e5 (svn r10773) -Codechange: use pool.CleanPool instead of CleanPool(&pool) and similarly for AddBlock*. 17 years ago
rubidium 2f89fef353 (svn r10759) -Codechange: make the industry struct use the pool item class as super class. 17 years ago
belugas 05a5967fbb (svn r10701) -Codechange: Make sure to not use an out of bound index when the index is specified by a grf file. It has a different meaning then. 17 years ago
belugas 3880be2fa8 (svn r10700) -Codechange: Enable to jump (by default) to the overriding industry tile spec of the one been queried.
Only on certain very specific circumstances do we need the original spec
17 years ago
rubidium 903a0a08c2 (svn r10698) -Codechange [FS#1082]: simplify the code related to foundations. Primarily removal of (duplicated|magic) code and introduction of few helper functions to ease foundation determination. Patch by frosch. 17 years ago
rubidium a67957866a (svn r10697) -Codechange: give a more sensible names to some of the unkX variables. 17 years ago
rubidium a26ef1ee3a (svn r10696) -Codechange: remove duplication of the "make sprite transparent" code. 17 years ago
rubidium 151262c1eb (svn r10675) -Codechange: unhardcode the industry types used in several locations of the source code. 17 years ago
belugas b6ba945486 (svn r10641) -Fix(r10638): Forgotten Son... err...include 17 years ago
belugas 79c94729b5 (svn r10640) -Fix(r10638): little typo... 17 years ago
belugas 71637303a9 (svn r10639) -Codechange: Give meaninfull name to a magic number 17 years ago
belugas 1dd61a2249 (svn r10638) -Codechange: Save the mapping of the industries and tiles, making them persistent. 17 years ago
belugas 05e4b47613 (svn r10635) -Codechange: Correct some typos and code beautifying (a little bit) 17 years ago
rubidium df009178d4 (svn r10587) -Codechange: move the string/dparam related stuff from variables.h to strings.h 17 years ago
glx 9f2ca45987 (svn r10575) -Fix r10573: misplaced ) 17 years ago
belugas 1bee873376 (svn r10573) -Codechange: Use function CheckIfCallBackAllowsAvailability for random map generation as well as for ingame random industry creation 17 years ago
rubidium d1ef87f914 (svn r10508) -Codechange: allow customizable animation schemes for industries. 17 years ago
rubidium a9249181c7 (svn r10506) -Fix: the (manual) building of banks was always rejected. 17 years ago
rubidium e84363b4db (svn r10494) -Fix (r10490): possible null dereference in some exotic newgrfs. 17 years ago
rubidium f183f46561 (svn r10490) -Codechange: add support for industries on non-flat surfaces. 17 years ago
rubidium e207ba425f (svn r10485) -Codechange: add a callback mechanism to determine whether building an industry is allowed at a given location. 17 years ago
rubidium 37748a3152 (svn r10483) -Codechange: add support for callbacks to manipulate the building chance of farm fields and chopping chance for lumber mills. 17 years ago
maedhros 44db937929 (svn r10481) -Codechange: Show a news message with the new industry when primary industry prospecting succeeds. 17 years ago
rubidium 95ea8fd2f1 (svn r10477) -Codechange: add some callbacks to customise the acceptance of industries. 17 years ago
rubidium cd702d049e (svn r10460) -Codechange: add some more variables needed for newindustries regarding to the creation of the industries. 17 years ago
rubidium b0a8409200 (svn r10459) -Codechange: add helper functions to determine whether an industry is a primary industry and how much it costs to build such an industry. 17 years ago
rubidium b8f658db94 (svn r10451) -Add: support for "prospecting" raw industries, i.e. you pay an amount of money and then it might (with a given chance) build a raw industry somewhere on the map. 17 years ago
rubidium 4c356457e6 (svn r10442) -Codechange: implement the industry production callback. 17 years ago
rubidium c0ba3dba9d (svn r10439) -Codechange: initial steps for customized industry productions. 17 years ago
belugas 2bedfcd3bf (svn r10425) -Fix (r10418): do not compare bitmasks with HASBIT. Strike two. Forgotten code :) 17 years ago
rubidium 2f14d622ae (svn r10419) -Fix (r10418): do not compare bitmasks with HASBIT. Thanks to Maedhros for spotting this. 17 years ago
rubidium 9534c9795b (svn r10418) -Codechange: implement/resurrect the industry production flags. 17 years ago
rubidium 0debbfd73d (svn r10406) -Fix [FS#968]: only industries in the temperate climate should be affected by the "do not increase production" flag. 17 years ago
rubidium ab52e3da52 (svn r10348) -Fix (r10347): compile errors; do not think it compiles fine when you run make on the wrong working copy. 17 years ago
rubidium 89a4ee256e (svn r10347) -Fix [FS#948]: industries with a very low production could never recover when using smooth economy.
-Fix: in smooth economy producing industries could not close, whereas they could close in non-smooth economy.
-Fix: in smooth economy the "do not increase production" flag of industries was ignored.
17 years ago
truelight 65455f5e07 (svn r10340) -Fix: make sure no industry production can ever hit < 32 with smooth_economy 17 years ago
rubidium 5ee292d806 (svn r10299) -Codechange [FS#931]: industry foundations should be drawn as all other foundations, i.e. with DrawFoundation, instead of writing the same functionality itself. 17 years ago
truelight b1f60c582f (svn r10290) -Fix: with smooth_economy, when industry production hit 32, it stayed there for ever. Give it some chance to get out of that uber-lowness (although it is a very slim chance, at least it has one) 17 years ago
belugas d4632dee67 (svn r10232) -Fix(r1): _numof_industry_table never was composed of 12 entries. Only 11.
It never hurt before, but it would have...
17 years ago
belugas c492167f74 (svn r10226) -Codechange: Add support for newindustry tiles drawing.
Heavily based on Maedhros's newhouses implementation
17 years ago
rubidium 773a7c9cb6 (svn r10205) -Codechange: refactor returning of cost, so it can be more easily modified. 17 years ago
rubidium 3ccc83e640 (svn r10197) -Codechange: replace int32 with CommandCost where appropriate. 17 years ago
belugas 0dc6ed160c (svn r10163) -Fix(r8128): Industries had lost their random recoloring. A test was removed and is now reintroduced in another way. 17 years ago
rubidium d88f4bc78c (svn r10140) -Fix [FS#867]: an industry could overbuild a bridge. 17 years ago
belugas cb65217069 (svn r10099) -Fix(r9867, FS860): Use the specs of the to-be-created industry instead of the scanned industry
Spotted by Oxygene
17 years ago
belugas a8e4af3c52 (svn r10078) -Codechange: Centralize all industry counts data and access 17 years ago
belugas 256ee60545 (svn r10063) -Codechange: Change VARDEF for extern
-CodeChange: Add the count of industries, basic support for variable 67, var action02 forindustries
17 years ago
rubidium d255041365 (svn r10058) -Codechange: give some industry variable sensible names (like not telling "last_mo_production" when it is the production of the current month). 17 years ago
rubidium b0421273f2 (svn r10054) -Codechange: make the industries cost modifier look more like the original one, so it's much easier to support industries that use this original format. 17 years ago
rubidium eab80301fc (svn r9993) -Fix (r9992): smallish typos resulting in compile time errors. 17 years ago
belugas 06bc9866aa (svn r9992) -Codechange: Remove some hardcoded references to Industry IDs.
A few more to go
17 years ago
belugas c3f8c58157 (svn r9984) -Codechange: Remove an obsolete structure and a now meaningless enum, in favor of the "real thing" 17 years ago
belugas 0a3ebbbc22 (svn r9983) -Codechange: Use the "enabled" property of the industry spec. 17 years ago
belugas e4785e0376 (svn r9976) -Codechange: Declare a writable array of specs for industry and industry tiles.
It will be initialized by the original data upon game start.
Rename some enums to be more consistent too
17 years ago
belugas e7bbb79ff5 (svn r9969) -Codechange: Cleanup of industries (Step-14). Remove hardcoded-run-time tile acceptance and put in corresponding tile 17 years ago
rubidium 821e58ac95 (svn r9914) -Codechange: prepare GTTS and the pathfinders to handle multiple road types on a single tile. 17 years ago
peter1138 72972a1712 (svn r9887) -Fix (r9867): Industry production statistics messed up... 17 years ago
belugas 2e65d6e4e7 (svn r9886) -Codechange: Cleanup of industries (Step-13). Include the sounds table into the industry's spec. 17 years ago
belugas 662bee5b12 (svn r9870) -Codechange: Silence two compiler warnings and give proper type to the "type" member of industry struct 17 years ago
belugas c4b90f3137 (svn r9867) -Codechange: Remove data duplication. The exact same values can be found in the industry spec, so take it from there instead. 17 years ago
belugas 7de20df379 (svn r9762) -Feature: Two new difficulty settings : Very low number of towns and very low number of industries
Based on FS#289, by pitt2
17 years ago
belugas cd97dec5a7 (svn r9705) -Codechange: Merge some data arrays together, making a bit more logical units.
Calculate with a macro (for _industry_anim_offs_toys) the value of x, instead of doing it at run time.
And give some more descriptive names too...
17 years ago
belugas 0532eb2515 (svn r9676) -Codechange: introduce NUM_INDUSTRYTYPES instead of IT_END.
This makes the code clearer.
17 years ago
rubidium 7577954ced (svn r9672) -Cleanup: lots of coding style fixes around operands. 17 years ago
belugas cfaaad6384 (svn r9644) -Codechange: if else cascade into a switch case 17 years ago
belugas 436cb4296b (svn r9643) -Codechange: Simplify a test. 17 years ago