Commit Graph

33 Commits (ab535c0a8665e6380c5037d7b6f0a507fc91d36a)

Author SHA1 Message Date
Peter Nelson ab535c0a86
Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
8 months ago
Patric Stout 07730584d7
Codechange: make explicit when a TileIndex is cast to its basetype (#11190)
This prevents people accidentially assigning a TileIndex to a Date
or any other type they shouldn't.
10 months ago
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
11 months ago
Rubidium f9b5bc7ee6 Cleanup: the need for SQAutoFreePointers has gone 1 year ago
Rubidium bbcb55ebc9 Codechange: use std::string as script API return type 1 year ago
Rubidium 534f2419ad Add: precondition checks to functions that work with both valid company and deity
These are functions that either use ScriptObject::Command or ScriptObject::GetCompany.
This is a bit over-protective, but having the check everywhere makes it easier to
validate that no check is missing automatically instead of by review.

At this moment these checks will not do anything useful, as either IsValid or
IsDeity from ScriptCompanyMode returns true, but that will change later.
1 year ago
Rubidium 83946ca31d Codechange: use GSCompanyMode::IsValid, IsDeity, and the precondition helpers
Direct 1:1 replacements in the code, and comments now refer to either
GSCompanyMode::IsValid or GSCompanyMode::IsDeity instead of several variations
on "company mode active" or "no company mode active".
1 year ago
glx22 446ebaa6b9 Codechange: Use SQInteger for generic numbers in script_road 1 year ago
glx22 b6f3552e4b Fix: [Script] Inconsistent precondition failure return values 1 year ago
Jonathan G Rennison 4c1406a4b5 Add: NewGRF road stops 1 year ago
Michael Lutz 9b3326e3fd Codechange: [Script] Use std::vector instead of a hand-rolled alternative. 1 year ago
SamuXarick 3dda8c9bad Fix: ScriptRoad::HasRoadType really check for RoadType
Script::HasRoadType was only checking if the tile had the same RoadTramType as that of the RoadType provided.
Now it really checks RoadType against RoadType.
2 years ago
Tyler Trahan db98cedb7e Fix #9883: Show cost/income float over end tile of rail or road construction 2 years ago
Michael Lutz c6d7b98808 Codechange: Un-bitstuff landscape commands. 3 years ago
Michael Lutz 46bd2f1ced Codechange: Un-bitstuff remaining transport infrastructure commands. 3 years ago
Michael Lutz 6fe445e6c0 Codechange: Un-bitstuff station/depot/waypoint commands. 3 years ago
Michael Lutz 6691ee3b96 Codechange: Template script command calls. 3 years ago
SamuXarick 971201b3b7 Fix: [AI/GS] CanBuildConnectedRoadPartsHere neighbours tiles were at times incorrect 4 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
peter1138 3293f08e0b Add: New RoadType API functions. 5 years ago
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
glx22 66dd7c3879
Fix: MSVC warnings (#7423) 5 years ago
michi_cc 2b8bb12d62 (svn r27381) -Fix: Warnings due to C++11 requirements for explicit narrowing conversions in initializer lists. 9 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
frosch bf0e7c34e6 (svn r26149) -Fix [FS#5825]: [Script] Various API functions did not check whether ScrtipRoad::SetCurrentRoadType was called appropiately. 11 years ago
rubidium eec66b089d (svn r26138) -Fix [FS#5821] (r26105-ish): [Script] scripts could trigger the internal IsValidRoadType assertion 11 years ago
zuu 1f764f51f0 (svn r24628) -Fix: Document and enforce precondition start != end for ScriptRoad::RemoveRoad and ScriptRoad::RemoveRoadFull 12 years ago
truebrain 9b6b2cabc1 (svn r23633) -Add: allow most build commands from GameScript given a CompanyMode is active in that scope 13 years ago
truebrain cc3f42794d (svn r23632) -Add: GSCompanyMode, to change company in GameScripts 13 years ago
michi_cc 0e5e8fff12 (svn r23416) -Add: [NoAI] API for querying infrastructure costs. 13 years ago
truebrain 98103121d4 (svn r23355) -Codechange: rename all AI* to Script* (Rubidium) 13 years ago
truebrain afdb67a353 (svn r23354) -Codechange: move all src/ai/api/ai_*.[hc]pp files to src/script/api/script_* (Rubidium) 13 years ago