1
0
Fork 0

Fix #13155: Set number of parameters when assigning from GRFConfig to GRFFile.

pull/13156/head
Peter Nelson 2024-12-07 20:42:45 +00:00
parent 3d73c95080
commit 460110303c
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 2 additions and 1 deletions

View File

@ -9007,7 +9007,8 @@ GRFFile::GRFFile(const GRFConfig *config)
* 'Uninitialised' parameters are zeroed as that is their default value when dynamically creating them. */ * 'Uninitialised' parameters are zeroed as that is their default value when dynamically creating them. */
this->param = {}; this->param = {};
auto last = std::begin(config->param) + std::min<size_t>(std::size(config->param), GRFConfig::MAX_NUM_PARAMS); this->param_end = std::min<uint>(static_cast<uint>(std::size(config->param)), GRFConfig::MAX_NUM_PARAMS);
auto last = std::begin(config->param) + this->param_end;
std::copy(std::begin(config->param), last, std::begin(this->param)); std::copy(std::begin(config->param), last, std::begin(this->param));
} }