1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 18:25:16 +01:00

Reduce casting for objects

This commit is contained in:
Michael Steenbeek
2024-10-16 14:12:25 +02:00
committed by GitHub
parent 5934dc6380
commit 8063c5caa7
33 changed files with 71 additions and 33 deletions

View File

@@ -1862,7 +1862,7 @@ static bool FootpathIsLegacyPathEntryOkay(ObjectEntryIndex index)
{
bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode);
auto& objManager = OpenRCT2::GetContext()->GetObjectManager();
auto footpathObj = static_cast<FootpathObject*>(objManager.GetLoadedObject(ObjectType::Paths, index));
auto footpathObj = objManager.GetLoadedObject<FootpathObject>(index);
if (footpathObj != nullptr)
{
auto pathEntry = reinterpret_cast<FootpathEntry*>(footpathObj->GetLegacyData());