diff options
author | Peter Nelson <peter1138@openttd.org> | 2021-05-01 23:58:18 +0100 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2021-05-02 09:41:01 +0100 |
commit | f785a70a2bc08eaefcb1e2a43b8e6d36a154a00e (patch) | |
tree | 3d2b4cc2a61484c6ea6876b4c8eda2a85ab408d7 /src/newgrf_station.cpp | |
parent | e097c83c83ac3be81041a67f8d641650045502fb (diff) | |
download | openttd-f785a70a2bc08eaefcb1e2a43b8e6d36a154a00e.tar.xz |
Cleanup: Use std::vector in RealSpriteGroup.
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r-- | src/newgrf_station.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index fa3f831aa..9aa3ad43b 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -523,13 +523,13 @@ uint32 Waypoint::GetNewGRFVariable(const ResolverObject &object, byte variable, cargo = std::min(0xfffu, cargo); if (cargo > this->station_scope.statspec->cargo_threshold) { - if (group->num_loading > 0) { - uint set = ((cargo - this->station_scope.statspec->cargo_threshold) * group->num_loading) / (4096 - this->station_scope.statspec->cargo_threshold); + if (!group->loading.empty()) { + uint set = ((cargo - this->station_scope.statspec->cargo_threshold) * (uint)group->loading.size()) / (4096 - this->station_scope.statspec->cargo_threshold); return group->loading[set]; } } else { - if (group->num_loaded > 0) { - uint set = (cargo * group->num_loaded) / (this->station_scope.statspec->cargo_threshold + 1); + if (!group->loaded.empty()) { + uint set = (cargo * (uint)group->loaded.size()) / (this->station_scope.statspec->cargo_threshold + 1); return group->loaded[set]; } } |