mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-21 11:22:45 +01:00
Codechange: Simplify usage of GRFFileProps by adding some common helper methods.
This commit is contained in:
@@ -1086,8 +1086,7 @@ VehicleResolverObject::VehicleResolverObject(EngineID engine_type, const Vehicle
|
||||
if (this->root_spritegroup == nullptr) {
|
||||
const Engine *e = Engine::Get(engine_type);
|
||||
CargoType cargo = v != nullptr ? v->cargo_type : CargoGRFFileProps::SG_PURCHASE;
|
||||
this->root_spritegroup = e->grf_prop.GetSpriteGroup(cargo);
|
||||
if (this->root_spritegroup == nullptr) this->root_spritegroup = e->grf_prop.GetSpriteGroup(CargoGRFFileProps::SG_DEFAULT);
|
||||
this->root_spritegroup = e->grf_prop.GetFirstSpriteGroupOf({cargo, CargoGRFFileProps::SG_DEFAULT});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user