Commit Graph

63 Commits (8ef3f896f5f20992b18e0ecea7cfa59b8fdffc67)

Author SHA1 Message Date
Darkvater cb5107f97f (svn r2345) - Fix: Don't allow stuff to be renamed to nothing if we don't support it. Only valid ones are signs (delete) and waypoints (rename to default). 19 years ago
tron fea5965679 (svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes. 19 years ago
Darkvater 921cc4e94a (svn r2297) - CodeChange: server-check the next batch of commands.
- CodeChange: since only the server will be able to modify difficulty settings, leave the checking of correct values besides, and trust users will join legit servers.
- CodeChange: for renaming signs, only check if GetDParam(); eg _decode_parameters is empty ('\0') or not, instead of the extra check of players, etc. That basically does the same thing. Also dirty sign two times when renaming, once before, once after the action. Because if the name becomes shorter and you update only after, garbage remains on the screen.
- CodeChange: made GetMaskOfTownActions() available to the town-cmd to double-check if the action was available to the player. For this purpose the hardcoded _local_player has been removed from the function and is now passed as a parameter.
19 years ago
Darkvater fc411d3675 (svn r2142) - Fix: Game no longer crashes when you want to remove a piece of road under a bridge that belongs to the town. TODO: railcrossings store owner somewhere else, put it into _map_owner[]! 20 years ago
pasky 087d78d465 (svn r2033) - Fix: Fix some more desync by saving the town growth frequency iterator _cur_town_iter. Needed to bump a svg revision for that thanks to the braindead SlGlob thing, or at least I don't know how to do it without bumping it. 20 years ago
pasky ad579912f4 (svn r2021) Fix: Enlarge _cur_town_ctr from byte to uint32 so that all the towns are considered when growing them even for big maps, where much more than 256 towns are around; reported by Tomasz Dubiński <uboottd@hydra.polsl.gliwice.pl>. The savegame still saves just the lowest 8 bits but that doesn't hurt so much. 20 years ago
Darkvater 010d1a9be3 (svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
- Fix: [ 1153926 ] All my settings in vain... IGNORED!
- Change: I hope I got it all right. Pressing 'New Game' (either choosing random or a preset scenario) and 'Create Scenario' will start a new game with the settings and difficulty in the intro menu. Using 'Load Game' and 'Play Scenario' will take the values from the savegame/scenario itself.
20 years ago
pasky 0e4828e732 (svn r1955) Fix: Make the town growth frequency scale properly both up and down. The scaling is now also based on the number of towns instead of the map size. (In cooperation with HackyKid.) 20 years ago
pasky f1f1783aa8 (svn r1952) Fix: Hopefully fixed the enormous towns growth slowdown in large maps. (Inspired by toholio.) 20 years ago
pasky b5a96ff9c1 (svn r1925) Fixed an infinite loop if the town generator runs out of town names. The number of generated towns is then limited by the number of available names. 20 years ago
celestar fe6f9e9a65 (svn r1881) -Fix: [ 1119308 ] Max passengers / mail variables are now 32 bit 20 years ago
celestar 77d26759e3 (svn r1866) -Fix: Intercepted generated maps with 0 towns on it. Currently just an
error() is called, some more graceful handling should be implemented
later.
20 years ago
tron f8d97a5f61 (svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters 20 years ago
tron 27dc506a03 (svn r1832) Next byte -> char iteration: custom names 20 years ago
truelight cc8fc19d4a (svn r1831) -Fix: Scenario Editor now handles human-made roads better (try to build
a city layout before placing the city, finally that works very nice)
20 years ago
tron 0381073e56 (svn r1813) Declare functions implemented in strings.c in their own shiny new header (though i think some of these function don't belong into strings.c) 20 years ago
tron 7aae12d55d (svn r1808) Use strcmp() instead of home brewed function str_eq() 20 years ago
truelight 7241f42e9d (svn r1784) -Fix: removed ClosestTownFromTile where possible, or replaced it
with _map2-data if possible (Celestar / TrueLight)
20 years ago
celestar 30a328705e (svn r1768) -Codechange: Store town index in _map2 of town tiles
Moved house type from _map2 to _map3_hi for MP_HOUSE
  Moved foundation and roadworks from _map2 to _map3 for
MP_STREET
  This increases game speed by a factor of around 15(!) if many cities are around.
  Converting an old game is done automagically, but can take a while
20 years ago
truelight 0be987391b (svn r1765) -Fix: on loading, the total amount of towns wasn't reset to zero 20 years ago
truelight 777dd99585 (svn r1764) -Add: dynamic towns, you can now have up to 64k towns (let me know when
you have that amount of towns in a map ;))
20 years ago
tron aa592190dc (svn r1756) Cleanup: if cascade -> switch, uint -> TileIndex 20 years ago
tron 7bbcf5875c (svn r1749) Move the functions which calculate distances to map.[ch] and give the more meaningful names 20 years ago
tron 5885b31bb4 (svn r1713) Split off several functions which query/set information about a single tile from map.h and put them into a seperate file tile.h 20 years ago
tron 3617d24318 (svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D()
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.
20 years ago
tron 993a106679 (svn r1676) Increase the size of TileIndex and TileIndexDiff to 32bits and 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!
20 years ago
tron 189ca73707 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile 20 years ago
celestar 962dd27a8c (svn r1581) Added a display for the total map population to the town display (Jango) 20 years ago
tron ef923fae44 (svn r1542) Rename TileHeight to TilePixelHeight, because this is what it actually returns 20 years ago
tron ae796740aa (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts 20 years ago
celestar febac23b25 (svn r1504) enummed town ratings (Jango) 20 years ago
tron 7ca6b2b8b0 (svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY] 20 years ago
truelight 63e97754fb (svn r1407) -Codechange: changed a lot around _stations, _vehicles, _towns 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 *.
20 years ago
tron f8c95a1dbe (svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff 20 years ago
tron 67161506ad (svn r1386) Move TileIndexDiff to map.h
Move _tileoffs_by_dir to map.[ch] and encapsulate it in TileOffsByDir()
20 years ago
tron c0702318d2 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY] 20 years ago
truelight 2ebc5011f3 (svn r1313) -Fix: fixed MSVC problem 20 years ago
truelight 92ac503b74 (svn r1312) -Add: Patch which is on by default: population in label of the town
-Fix: Expand town is a bit more agressive
-Fix: Fixed a bug in growing algorithm
20 years ago
truelight 546fcfa3ec (svn r1301) -Codechange: _industries finally has FOR_ALL_INDUSTRIES too 20 years ago
truelight c2ee8d70e4 (svn r1288) -Codechange: changed _map2 to an uint16. It is still saved and loaded as
an uint8 till the savegame version is bumped to version 5. Then it works 
automaticly as a fully uint16. So _stations[] can not be increased till 
after the bump!!
20 years ago
tron 765ecfed84 (svn r1117) Move map arrays and some related macros into their own files map.c and map.h 20 years ago
truelight b8f6d41418 (svn r942) -Merged branch/network back into the trunk 20 years ago
tron fdb447ac55 (svn r901) Small step in the process to clean up the DPARAM mess:
- reduce to 2 sizes (*DParam64 for 64bit values, *DParam for the rest)
- use inline functions instead of macros
- add assert()s to check for buffer overruns
20 years ago
pasky 97c533eb9c (svn r831) Remove station-specific roadbits magic. Tron already fixed road stations so that they don't give out roadbits in r780. 20 years ago
pasky 0554031514 (svn r830) Move the MP_STATION roadbits guard to GetTownRoadBitsByTile() wrapper of GetRoadBitsByTile(). This should really and for once fix the road-behind-road-station bug. 20 years ago
tron acbd1801c7 (svn r815) Include strings.h only in the files which need it.
This should reduce the compile time after altering english.txt by about 1/3, because "only" 62 instead of 90 .c files must be recompiled.
20 years ago
tron e8537f5512 (svn r787) Invert the sense of the DO_TRANS_BUILDINGS flag to be consistent with its own name and all other DO_* flags.
Now it is active-true.
20 years ago
tron d51887fbed (svn r764) Enumerate the houses only one per town can exist and use the enums instead of magic numbers to check for these 20 years ago
tron 8a3d7cce1c (svn r760) Replace some bit-juggling with bit fields 20 years ago
tron 40a04816a4 (svn r756) Demystify and explain some piece of code regarding which house sprite to draw 20 years ago