mirror of https://github.com/OpenRCT2/OpenRCT2.git
Apply review requests
This commit is contained in:
parent
b3bbdcbfd5
commit
b627dbd3a4
|
@ -304,7 +304,7 @@ std::unique_ptr<IStream> ObjectAsset::GetStream() const
|
|||
|
||||
ObjectEntryDescriptor::ObjectEntryDescriptor(const ObjectRepositoryItem& ori)
|
||||
{
|
||||
if (ori.Identifier != "")
|
||||
if (!ori.Identifier.empty())
|
||||
{
|
||||
Generation = ObjectGeneration::JSON;
|
||||
Identifier = std::string(ori.Identifier);
|
||||
|
|
|
@ -63,12 +63,7 @@ void TerrainEdgeObject::ReadJson(IReadObjectContext* context, json_t& root)
|
|||
|
||||
TerrainEdgeObject* TerrainEdgeObject::GetById(ObjectEntryIndex entryIndex)
|
||||
{
|
||||
TerrainEdgeObject* result = nullptr;
|
||||
auto& objMgr = OpenRCT2::GetContext()->GetObjectManager();
|
||||
auto obj = objMgr.GetLoadedObject(ObjectType::TerrainSurface, entryIndex);
|
||||
if (obj != nullptr)
|
||||
{
|
||||
result = static_cast<TerrainEdgeObject*>(obj);
|
||||
}
|
||||
return result;
|
||||
return obj != nullptr ? static_cast<TerrainEdgeObject*>(obj) : nullptr;
|
||||
}
|
||||
|
|
|
@ -150,12 +150,7 @@ uint32_t TerrainSurfaceObject::GetImageId(
|
|||
|
||||
TerrainSurfaceObject* TerrainSurfaceObject::GetById(ObjectEntryIndex entryIndex)
|
||||
{
|
||||
TerrainSurfaceObject* result = nullptr;
|
||||
auto& objMgr = OpenRCT2::GetContext()->GetObjectManager();
|
||||
auto obj = objMgr.GetLoadedObject(ObjectType::TerrainSurface, entryIndex);
|
||||
if (obj != nullptr)
|
||||
{
|
||||
result = static_cast<TerrainSurfaceObject*>(obj);
|
||||
}
|
||||
return result;
|
||||
return obj != nullptr ? static_cast<TerrainSurfaceObject*>(obj) : nullptr;
|
||||
}
|
||||
|
|
|
@ -145,10 +145,10 @@ void mapgen_generate(mapgen_settings* settings)
|
|||
const auto selectedEdge = TerrainEdgeObject::GetById(settings->wall);
|
||||
std::string edgeTexture = selectedFloor != nullptr ? std::string(selectedEdge->GetIdentifier()) : "";
|
||||
|
||||
if (floorTexture == "")
|
||||
if (floorTexture.empty())
|
||||
floorTexture = BaseTerrain[util_rand() % std::size(BaseTerrain)];
|
||||
|
||||
if (edgeTexture == "")
|
||||
if (edgeTexture.empty())
|
||||
{
|
||||
// Base edge type on surface type
|
||||
if (floorTexture == "rct2.surface.dirt")
|
||||
|
|
Loading…
Reference in New Issue