Commit Graph

381 Commits (db3b086a52b44b2d5960a25ef2f46317f4280934)

Author SHA1 Message Date
Peter Nelson 76516d7f70 Codechange: Use IsValidCargoID/IsValidCargoType.
IsValidCargoType() is used only for unmapped IDs.
1 year ago
Rubidium acec34a0fe Cleanup: remove MD5SumToString in lieu of FormatArrayAsHex 1 year ago
Patric Stout 7634553d22 Feature: opt-in survey when exiting a game
On first start-up, the game will ask if you want to participate
in our automated survey. You have to opt-in, and can easily opt-out
(via the Options) at any time.

When opt-in, whenever you exit a game, a JSON blob will be send
to the survey server hosted by OpenTTD. This JSON blob contains
information that gives a global picture of the game just played:
- What settings were used
- How many humans vs AIs
- How long the game has been played
- Basic information about the OS / CPU

All this information is kept very generic, so there is no
chance we send private information to our survey server.
Nothing in the JSON blob could identify you as a person; it
mostly tells about the game played. At any time you can see
what the JSON blob includes, by pressing the "Preview Survey
Results" button in-game.
1 year ago
Michael Lutz 72c7536325
Codechange: Use a dedicated variable for disaster vehicle action state. (#10798) 1 year ago
Peter Nelson e6740046ee Codechange: Use range-for iteration. 1 year ago
Peter Nelson cef3a2570d Codechange: Use standard iterator-erase-loop pattern. 1 year ago
Rubidium fb856e16c1 Codechange: replace some min/clamp constructs to ClampTo 1 year ago
Rubidium a312a6c1b2 Codechange: make md5sumToString std::string compatible 1 year ago
Tyler Trahan 6501f84b4a
Codechange: Move calendar date functions inside TimerGameCalendar (#10753) 1 year ago
Peter Nelson 00bf42353a Codechange: Place gamelog into its own class, along with internal data.
Data is now stored in vectors to avoid manual memory management and
passing lengths around.
1 year ago
Patric Stout 36a0818bc5
Remove: buying/selling/owning company shares (#10709) 1 year ago
Rubidium 33c4fbff8f Codechange: use fmt::format_to instead of seprintf to fill load crash message 1 year ago
Patric Stout 31ad990831
Codechange: move tick-counter into TimerGameTick (#10712) 1 year ago
Patric Stout 7aa2b9ab0a
Codechange: move all date-related variables inside the timer (#10706) 1 year ago
Rubidium f5f6306af3 Codechange: use string/fmt instead of printf for ShowInfo(F) 1 year ago
PeterN e97bf271dc
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
1 year ago
Patric Stout ed83c4b0da
Change: replace per-AI "start_date" with a global "competitors_interval" (#10653)
The per-AI "start_date" is a lot of custom code, and was rarely
used in the way it was meant.

While at it, also ported this part over to the new timer system.
1 year ago
Tyler Trahan 646a7e625b
Change: Use seconds for Linkgraph update settings (#10610) 1 year ago
Rubidium 9d2a0f3d0b Change: make GetPartialZ consistent, meaning Z of adjacent slopes continue
Previously, on a straight line of a one corner up slope with the adjacent
steep sloop the Z would increase one step every two sub pixels, except for one
case where one sub pixel is skipped. Similarly, a steep slope with two
adjacent one corner up slopes, would have a bump in the height line along the
diagonal whenever it enters/leaves the steep slope tile.
1 year ago
Rubidium e8af8daa68 Codechange: pass "ground vehicle" to GetTileSlopeZ since for tunnel/bridges there are two states
Previously it checked the position in non-driving direction to "guess" whether
a ground vehicle was using the function, so on tunnels/bridges it could either
return the Z of the (virtual) ground compared to the Z of the path the vehicle
would take.
1 year ago
PeterN f1144de509
Feature: Separate rail/road and sea/air velocity units, and add knots. (#10594)
This is achieved by packing vehicle type along with the velocity so that
the string system can decode and pick the appropriate unit.
1 year ago
Peter Nelson 65e0b0dcb7 Codechange: Be consistent with how company masks are set to all. 2 years ago
Rubidium 580d0a6343 Codechange: make use of Tile in for all direct map accesses 2 years ago
Rubidium 0fb0469e47 Codechange: introduce iterator to iterate over the Tiles of a Map
Note: this version is using TileIndex, but that changes later
2 years ago
dP b0542c8c49
Codechange: Don't store tree counter in the map array (#10018) 2 years ago
Loïc Guilloux 4072dcff49
Fix #10486: [Script] Debug window requires AIs to be started before GS (#10487) 2 years ago
glx22 b080f24bd8 Codechange: move windows common to AI and GS out of ai_gui 2 years ago
Rubidium 4e65ec1dc4 Codechange: do not declare functions in blocks 2 years ago
Tyler Trahan 9c5de7fd72
Fix #10395: When loading old saves, don't forcibly bar level crossings (#10400) 2 years ago
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 2 years ago
Rubidium c5ff61c5f2 Add: script specific Randomizer instances 2 years ago
PeterN c18a171028
Fix #10331: Starting new company during load must happen after AI start. (#10332)
This situation occurs when loading a savegame in single-player which only
has AI companies.
2 years ago
Rubidium 375a5b8e3f Codechange: refactor FindClosestDepot to not use pointers, but return a struct 2 years ago
Loïc Guilloux fe30f66570
Fix #9720: Delay start of GS/AI to after loading of savegame (#9745) 2 years ago
Loïc Guilloux 13d2d11fa8
Fix #10216: Initialise RoadStop caches before using them and don't try to teleport crashed vehicles (#10217) 2 years ago
Tyler Trahan c19abebf8d
Feature: Multi-track level crossings (#9931) 2 years ago
Nicolas Chappe f8a7b76675 Fix #9665: [Linkgraph] Fix travel times of non-direct journeys 2 years ago
Tyler Trahan ec90fb4c99 Fix #6544: Don't join AI company when loading network game in singleplayer 2 years ago
Rubidium c73f578e8c Codechange: replace magic numbers and C-style arrays with C++-style array for share owners 3 years ago
Niels Martin Hansen e68bf58989 Codechange: Use anonymous union for vehicle orders/old orders list 3 years ago
Charles Pigott cf16f452da
Fix #9680: Recalculating aircraft positions before map array updates caused crashes (#9699) 3 years ago
Dmitry Erlikh 33ef34189e
Fix #9648: add missing commas in crash message 3 years ago
SamuXarick e404d16929
Fix #9591: Update station docking tiles upon placing a water object on a docking tile (#9594) 3 years ago
Loïc Guilloux 38a64eb2aa
Change: Allow all tiles around docks to be docking tiles (#9578) 3 years ago
Patric Stout 4e645ce749 Codechange: using "until" in function names can be confusing
IsSavegameVersionUntil() did a [0, N] check, not [0, N) as the
name suggests.

Until can be a confusing word, where people consider it to be
including the upperbound. Dictionary states it means "before",
excluding the upperbound. There are long debates about who is right.

So, simply remove away from this ambiguity, and call it "before"
and "before or at". This makes the world easier for everyone.
3 years ago
Rubidium 357af686dc Cleanup: use true/false instead of 1/0 where applicable 3 years ago
Patric Stout 1e432fbd71
Fix 81062163: for (really) old games, station bus/truck station cache was not updated (#9366) 3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
Patric Stout f997eb6ca4
Fix: compatible NewGRFs in crash-log reported wrong md5 (#9340)
The text suggests it reports the original md5, but it does in fact
report the replaced md5. Now it reports both.
3 years ago
rubidium42 44ca7d9377 Change: Use gender-neutral pronouns 3 years ago