MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SetParameterDefaults

Method SetParameterDefaults

src/newgrf_config.cpp:114–124  ·  view source on GitHub ↗

Set the default value for all parameters as specified by action14. */

Source from the content-addressed store, hash-verified

112
113/** Set the default value for all parameters as specified by action14. */
114void GRFConfig::SetParameterDefaults()
115{
116 this->param.clear();
117
118 if (!this->has_param_defaults) return;
119
120 for (const auto &info : this->param_info) {
121 if (!info.has_value()) continue;
122 this->SetValue(info.value(), info->def_value);
123 }
124}
125
126/**
127 * Set the palette of this GRFConfig to something suitable.

Callers 5

OnClickMethod · 0.80
UpgradeCurrentMethod · 0.80
AddGRFToActiveMethod · 0.80
GetBasesetExtraGRFConfigFunction · 0.80
OnClickMethod · 0.80

Calls 3

SetValueMethod · 0.95
clearMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected