Commit Graph

738 Commits (ae27ce12a755fb9685d96a237f5ef636e8318b69)

Author SHA1 Message Date
glx22 ae27ce12a7 Fix 0858377: [Script] Don't output parameters more than once 4 months ago
Michael Lutz 8dda387f82 Codechange: Use std::tuple for slope functions with two return values 4 months ago
Loïc Guilloux 845b894fd8
Remove: [Script] random_deviation from setting description table (#12221) 4 months ago
Loïc Guilloux f612bc6ee2
Fix bf4b6696: [Script] Broken ScriptText circular reference detection (#12187) 4 months ago
Rubidium a4d4301a0c Codechange: We are heading to 15 4 months ago
SamuXarick 8584d1b5bb
Add: [Script] GetAirportNumHelipads (#12085)
Adds a function for Scripts to get the number of helipads of an airport type.
5 months ago
SamuXarick fa64fff4a5
Fix #10405, a3dd750: [Script] Test engine and vehicle type validity for ScriptGroup::GetNumEngines (#11887) 5 months ago
Loïc Guilloux b0f3417025
Add: [Script] ScriptTileList_StationCoverage (#12015) 5 months ago
Loïc Guilloux 0858377e9e
Fix: [Script] Don't kill GS misusing GSText (#12009) 5 months ago
merni-ns 34b05465d5
Fix 5a88027: [Script] Avoid overflow in scripts when infinite money is enabled (#12016) 5 months ago
Peter Nelson 2fd9096070
Change: Decouple and remove landscape-dependent cargo types. (#11719)
Cargo types of default engines, industries and houses are now specified in terms of label.
5 months ago
Patric Stout 849fd5ae03
Change: [Script] replace easy/medium/hard values with default value (#11959) 5 months ago
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 5 months ago
Peter Nelson 60dcf3b5e2 Codechange: Rename TownEffect to TownAcceptanceEffect.
This makes it clearer that TownEffect only affects acceptance behaviour.
5 months ago
Loïc Guilloux 4e26e33805
Change: Improve ScriptSettings windows (#11958) 5 months ago
Loïc Guilloux 3545decf2d
Cleanup e28edf6945: [Script] Left over CONFIG_RANDOM reference in documentation (#11954) 5 months ago
Loïc Guilloux ab1407fc43
Fix: [Script] Apply random deviation only at script start (#11944) 5 months ago
Patric Stout e28edf6945
Remove: [Script] CONFIG_RANDOM from AddSetting flags (#11942)
It had a very weird interaction, and was only ever used by a single
AI.
5 months ago
glx22 a502453033 Fix 48b6b18: Increase MAX_VALUATE_OPS to match the previous limit 5 months ago
dP 897b59c158
Add: [GS] Allow to set max loan for each company separately (#11224) 5 months ago
merni-ns 5a88027a19
Feature: Infinite money mode (#11902) 5 months ago
dP acaceb45ba
Codechange: Make command constant names consistent with command proc (#11920) 5 months ago
SamuXarick 0c4e509b60
Fix #10439: [GS] Validate story page button colour, flags, cursor and vehicle type (#11892)
Adds GSStoryPage::IsValidStoryPageButtonColour, GSStoryPage::IsValidStoryPageButtonFlags and GSStoryPage::IsValidStoryPageButtonCursor to the API.

Add missing enforced preconditions to validate parameters passed to MakePushButtonReference, MakeTileButtonReference and MakeVehicleButtonReference.
5 months ago
SamuXarick 76f0f9e386
Fix #10438: [GS] Validate story page element type for ScriptStoryPage::NewElement (#11888)
Fixes a crash that happens if an invalid StoryPageElementType is passed to ScriptStoryPage::NewElement.

Adds an enforced precondition that tests the validity of StoryPageElementType.

Adds GSStoryPage::IsValidStoryPageElementType to the API.
5 months ago
Tyler Trahan bbdbf9a589
Add: AI/GS Time Mode to choose between economy (default) and calendar time (#11603) 5 months ago
Peter Nelson 8797cc7ef2
Codechange: Replace GroupStatistics' num_engines with std::map. (#11849)
This removes manual memory management with calloc/free calls, and prevents potentially large arrays being allocated for each group.
5 months ago
Rubidium 1c694e433d Codechange: use std::popcount instead of hand written loop 5 months ago
Loïc Guilloux bf4b669628
Fix: [Script] Improve ScriptText validation (#11721)
The validation is now done in two steps:
 - First we get the list of parameters in the same order they used to be in encoded string
 - Then we validate the parameter types like FormatString would use them while encoding the string
5 months ago
Rubidium 2d77cf9c80 Codechange: replace StrStartsWith/StrEndsWith with starts_with and ends_with 6 months ago
Patric Stout bb49112784 Codechange: switch our codebase to C++20 6 months ago
Tyler Trahan 68814bd912
Codechange: Rename SIGTYPE_NORMAL to SIGTYPE_BLOCK (#11788) 6 months ago
Loïc Guilloux 54b57fbfeb
Codechange: [Script] Use ScriptList::FillList() in more locations (#11762) 6 months ago
Loïc Guilloux 28efa65e0c
Revert a2edf52: SQOpsLimiter does a more precise job (#11754) 6 months ago
Peter Nelson 400ae65ff2 Codechange: Redefine some cargo-related values in terms of CargoID instead of CargoType.
Values used as special filter types are now defined as offsets from NUM_CARGO instead of confusingly reusing CARGO_NO_REFIT/CARGO_AUTO_REFIT types.
6 months ago
Peter Nelson 952d111b94 Codechange: Split CT_INVALID into CT_INVALID and INVALID_CARGO.
INVALID_CARGO is a CargoID and should be used for most purposes in game.
CT_INVALID is a CargoType used for defining default properties.
6 months ago
Loïc Guilloux c86d918921
Add: [Script] Optional filter parameter to more ScriptXXXList constructors (#11698) 6 months ago
Peter Nelson 34e8c8e1c1
Codechange: Build station and depot vehicle lists from shared order lists. (#11676)
The brings some performance advantages:

* No need to iterate all vehicles and check for primary vehicle as only vehicles that can have orders are listed.
* Shared orders only need to be tested once instead of for each vehicle sharing them.
* Vehicle tests only need to be performed on the first shared vehicle instead of all.
6 months ago
glx22 7bfc766f94 Fix: [Script] document return type of member GSIndustry::GetProductionLevel 6 months ago
glx22 707e8001be Fix #11689: properly close DOXYGEN_API block 6 months ago
Peter Nelson 91ea8e3fa6
Codechange: Use locals for company/deity mode during script loops. (#11686) 6 months ago
Jonathan G Rennison 48b6b1844a
Change: Limit total script ops that can be consumed by a list valuate (#11670) 6 months ago
Loïc Guilloux a672813bb0
Add: [Script] Optional filter parameter to ScriptVehicleList constructor (#11663) 6 months ago
Peter Nelson a0dfb76e34 Codechange: Replace mishmash of types for widget index with WidgetID.
Indices were stored as int, but often passed around as uint/uint8_t and casts.

Now they should all use WidgetID.
6 months ago
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
6 months ago
Peter Nelson 33ff64ef74
Codechange: Simplify ConvertDateToYMD by returning YearMonthDay instead of outputting to a pointer. (#11637) 6 months ago
Loïc Guilloux 2d3af14181
Add: Horizontal scroll for script debug log (#11597) 6 months ago
Peter Nelson 0ca4b4e146 Change: Allow opening multiple script debug windows by holding Ctrl. 6 months ago
Tyler Trahan e8d2ebb016
Fix: Add missing includes to timers from script implementation files (#11604) 6 months ago
SamuXarick fddcaef74a Codechange: Use town zone constants instead of magic numbers 7 months ago
Loïc Guilloux 7726f8f245
Fix: [Script] Properly store the previous AsyncMode state (#11587) 7 months ago