Commit Graph

11 Commits

Author SHA1 Message Date
Peter Nelson 1773c5b810
Change: Increase object/station/roadstop class limit. (#12094)
The class limit is arbitrary and not stored in game state.

This change prevents all entities in classes after the 255th class from being dumped into the first class.
2024-04-09 23:16:20 +01:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Jonathan G Rennison 3b18877b87
Fix #11629: AirportGetNearestTown for rotated airports (#11631)
Add rotation parameter to AirportGetNearestTown
Add wrapper for existing stations
Remove unnecessary iterator cloning
2023-12-28 21:43:05 +00:00
Peter Nelson c0ea0589b4
Fix: AirportGetNearestTown incorrectly assumed first TileIterator result was origin. (#11565)
Not all TileIterators are equal, and some do not start at the top-corner, so the perimeter check was wrong. As the caller already has thie origin tile, use that instead.
2023-12-09 09:47:41 +00:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
PeterN 882f06bf14
Fix: Support more than 256 stations/waypoints/roadstops per class. (#10793)
It was already possible to define more than 256 per class, but not possible
to use them as the index used in GUI and passed through commands was limited
to a byte.
2023-05-08 18:09:33 +00:00
Jonathan G Rennison 4c1406a4b5 Add: NewGRF road stops 2023-02-26 21:28:30 +01:00
Rubidium 4e65ec1dc4 Codechange: do not declare functions in blocks 2023-01-29 20:28:45 +01:00
Patric Stout 100aca1848
Fix: CmdRemoveRoadStop didn't validate the height property properly (#9945)
Height was a unsigned 32bit integer, where TileAddWrap uses a
signed 32bit integer for the height. In result, there was an
implicit cast from unsigned to signed, messing things up.

But looking at it from a functional perspective, allowing such
large values is not sensible. In fact, width is restricted to
just a 8bit integer. By changing height to a 8bit integer too,
the implicit cast will never make a positive value negative anymore.
2022-07-09 12:27:58 +02:00
Michael Lutz 6fe445e6c0 Codechange: Un-bitstuff station/depot/waypoint commands. 2021-12-16 22:28:32 +01:00
Michael Lutz 33ca4f2b99 Codechange: Let the compile generate the master command table out of templated command traits.
This is using a non-intrusive type-traits like templated system, which
allows compile-time validation that the command table and the command
enum match up.
2021-12-16 22:28:32 +01:00