Cleanup: Use std::vector in RealSpriteGroup.
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user