Commit Graph

77 Commits (48d991b8197db61c41ac35b3b08be85344612ba5)

Author SHA1 Message Date
Darkvater feefbbbf06 (svn r4586) - Codechange: Recursive commands that rely on _error_message to handle success/failure can fail if a recursive call fails but doesn't set the error message, thus resulting in an old, possibly erroneous being used (see FS#130 prior to r4585). Now properly reset the global variable _error_message in these cases. 18 years ago
tron 18ad0ae50e (svn r4572) Remove vehicle_leave_tile_proc
There's exactly one implemented function (unbarring a level crossing) and one place where it can be triggered (a train leaves a level crossing)
It's a bit overkill, so just handle this one case where it can happen
18 years ago
tron c1dc517dab (svn r4554) Replace magic numbers by TILE_{HEIGHT,SIZE} 18 years ago
tron 0347fb2ab6 (svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums 18 years ago
tron 81e6d68f95 (svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex
Remove DoCommandByTile(), because now it does the same as DoCommand()
18 years ago
tron 99a6b9b8f2 (svn r4279) s/\<CL_/CLEAR_/ 19 years ago
celestar cc87f682b9 (svn r4249) -Codechange: Replace more occurences of 16 by TILE_SIZE and of 8 by TILE_HEIGHT. Reverted one change from the previous commit because it was faulty 19 years ago
tron 892a4c587d (svn r4242) Pass TileIndex and slope to GetSlopeTileh_*() instead of TileInfo 19 years ago
belugas 80570009dd (svn r4181) CodeChange : Replaced [G/S]etMapExtraBits by [G/S]etTropicZone. Although it was an accessor, nor his usage nor the values were clear. 19 years ago
tron 541703a2f6 (svn r4073) Add functions to make and test for (most) unmovable tiles 19 years ago
celestar fc32e20195 (svn r3992) -Fix: Rewrote the code to determine whether a rail-tile can be terraformed.
Fixes a bug where you could terraform a tunnel (fixed by r3228, but reverted that one)
Fixes a bug introduced by r3228 which allowed steep rail tiles resulting in ... unwanted effects such as display artifacts.
That means the terraform feature should not work as intended; it also uses _valid_tileh_slopes to determine valid configurations instead of hand-brewn stuff.
TODO: _terraform_err_tile and similar TileIndices should have INVALID_TILE as "unused", not 0. (0 is a valid tile).
19 years ago
tron 77e5cf4bc1 (svn r3979) Move GetRailFoundation() to rail_map.h and use it and friends to get information about rail tiles 19 years ago
tron 7bce62899c (svn r3794) Use already available accessor functions instead of GB() 19 years ago
tron 313754011d (svn r3779) Move CheckTunnelInWay() to a more appropriate place, invert its result and give it a less ambiguous name (IsTunnelInWay) 19 years ago
tron cc4f5b4e6f (svn r3763) Adapt to the new 'map accessors go in foo_map.h'-scheme 19 years ago
tron 453b30e387 (svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
19 years ago
tron 6132fcea44 (svn r3554) Add accessors for the field type and fences of clear tiles 19 years ago
tron 272a27b795 (svn r3515) Fix copy&pasto in r3514 19 years ago
tron ac4f4e30d5 (svn r3514) -Codechange: Replace direct fiddling of bits for the ground type and density of clear tiles with symbolic names and accessors.
See clear.h for details
19 years ago
tron 84fb96fe85 (svn r3511) More whitespace ([FS#46] by Rubidium) 19 years ago
tron 22dc05faf2 (svn r3510) Fiddle with whitespace and parentheses 19 years ago
tron 5e1e902600 (svn r3490) -Fix: A bunch (10) of off-by-one errors when checking if a TileIndex points to a tile on the map 19 years ago
peter1138 6ed22fb3d4 (svn r3249) Fix for issue introduced in r3228. The original code was good for raising, then for lowering, now for both. 19 years ago
peter1138 f6ddaf6a23 (svn r3228) - Fix: [ 1327011 ] Fix: don't lower land on tunnel, even with diag tracks on it (based on patch by glx) 19 years ago
tron f7abff5f96 (svn r3181) -Bracing
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
19 years ago
tron 833032adc0 (svn r3177) GB, CLRBIT, HASBIT, TOGGLEBIT 19 years ago
tron ece9b9b2b6 (svn r3066) Constify the parameter of GetSlopeZ_*() 19 years ago
tron d5042d4ab2 (svn r3046) Replace some numbers with sprite names and fix a typo in the sprite list 19 years ago
Darkvater 8e6a911700 (svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
- change a lot of byte player types to PlayerID
- beautify header files, same "#endif /* filename */" ending
19 years ago
tron 177fa1d163 (svn r2739) -Fix(?): Change the fence algorithm so it removes fences when no farm tile is adjacent 19 years ago
tron 64ac1a6414 (svn r2738) Small bit fiddling cleanup 19 years ago
tron a227065ab7 (svn r2701) Insert Id tags into all source files 19 years ago
tron 559babcdc9 (svn r2673) Include functions.h directly, not globally via openttd.h 19 years ago
tron e53c4db866 (svn r2664) Remove depedency on player.h from variables.h 19 years ago
tron 284d9ed7fb (svn r2663) Include variables.h only in these files which need it, not globally via openttd.h 19 years ago
tron d71788c402 (svn r2660) Get rid of some more shifting/anding/casting 19 years ago
tron ac66e3e28f (svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read 19 years ago
ludde 6013b327f7 (svn r2560) Fix: various minor code changes.
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.
19 years ago
tron 8c1d74162f (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes. 19 years ago
tron ab7b8b50e3 (svn r2492) Remove some pointless casts and fix some nearby indentation 19 years ago
tron bec5e4fb4c (svn r2487) Replace TILE_XY by TileXY/TileDiffXY 19 years ago
tron 61f6f07edd (svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY 19 years ago
tron cea090af09 (svn r2485) Missed two uint -> TileIndex, thanks _Luca_ 19 years ago
tron 3154e7148d (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile" 19 years ago
tron 0c4ecbe9ec (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner 19 years ago
Darkvater b438b1248c (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 19 years ago
Darkvater 0cd53574ec (svn r2384) - Fix: Check selling land and setting player colour. Also an extra map-bounds check for terraforming; inspired by the monkey (and Tron :) ) 19 years ago
Darkvater 033995ec6e (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
- CodeChange: remove cmd-misuses CmdStartScenario() and CmdDestroyCompanyHQ()
- Fix (invisible): when parameter checking CmdRestoreOrderIndex() the vehicle did not have its orders yet, so it would fail. So move doing this until AFTER the orders have been added back in RestoreVehicleOrders()
19 years ago
Darkvater edd8c87502 (svn r2286) - CodeChange: paramcheck the next batch of commands.
- Fix (regression): fix up terraform land where every player can terraform land (towns, map generation), and player can terraform different corners; used for building tunnels
19 years ago
Darkvater 3ad11e0ad4 (svn r2279) - Fix: Check the parameters of the first 10 Commands. While there also add proper comments for the functions and fix up CmdFailed() 19 years ago