diff --git a/src/openrct2-ui/scripting/ScTitleSequence.hpp b/src/openrct2-ui/scripting/ScTitleSequence.hpp index 593f4fbd5e..c2e61a04bf 100644 --- a/src/openrct2-ui/scripting/ScTitleSequence.hpp +++ b/src/openrct2-ui/scripting/ScTitleSequence.hpp @@ -69,44 +69,44 @@ namespace OpenRCT2::Scripting using namespace OpenRCT2::Title; DukObject obj(ctx); std::visit( - [&obj](auto&& value) { - using T = std::decay_t; + [&obj](auto&& command) { + using T = std::decay_t; obj.Set("type", T::ScriptingName); if constexpr (std::is_same_v) { - obj.Set("index", value.SaveIndex); + obj.Set("index", command.SaveIndex); } else if constexpr (std::is_same_v) { - obj.Set("x", value.Location.X); - obj.Set("y", value.Location.Y); + obj.Set("x", command.Location.X); + obj.Set("y", command.Location.Y); } else if constexpr (std::is_same_v) { - obj.Set("rotations", value.Rotations); + obj.Set("rotations", command.Rotations); } else if constexpr (std::is_same_v) { - obj.Set("zoom", value.Zoom); + obj.Set("zoom", command.Zoom); } else if constexpr (std::is_same_v) { - if (value.Follow.SpriteIndex.IsNull()) + if (command.Follow.SpriteIndex.IsNull()) obj.Set("id", nullptr); else - obj.Set("id", value.Follow.SpriteIndex.ToUnderlying()); + obj.Set("id", command.Follow.SpriteIndex.ToUnderlying()); } else if constexpr (std::is_same_v) { - obj.Set("speed", value.Speed); + obj.Set("speed", command.Speed); } else if constexpr (std::is_same_v) { - obj.Set("duration", value.Milliseconds); + obj.Set("duration", command.Milliseconds); } else if constexpr (std::is_same_v) { - obj.Set("scenario", String::ToStringView(value.Scenario, sizeof(value.Scenario))); + obj.Set("scenario", String::ToStringView(command.Scenario, sizeof(command.Scenario))); } }, value); diff --git a/src/openrct2/title/TitleSequence.cpp b/src/openrct2/title/TitleSequence.cpp index 9402d25d8e..35bc7c1fed 100644 --- a/src/openrct2/title/TitleSequence.cpp +++ b/src/openrct2/title/TitleSequence.cpp @@ -275,7 +275,7 @@ namespace OpenRCT2::Title seq.Saves.erase(seq.Saves.begin() + index); // Update load commands - for (auto& command : seq.Commands) + for (auto& seqCommand : seq.Commands) { std::visit( [index](auto&& command) { @@ -293,7 +293,7 @@ namespace OpenRCT2::Title } } }, - command); + seqCommand); } return true; @@ -507,7 +507,7 @@ namespace OpenRCT2::Title sb.Append("# SCRIPT FOR "); sb.Append(seq.Name.c_str()); sb.Append("\n"); - for (const auto& command : seq.Commands) + for (const auto& seqCommand : seq.Commands) { std::visit( [&buffer, &seq, &sb](auto&& command) { @@ -576,7 +576,7 @@ namespace OpenRCT2::Title sb.Append("END"); } }, - command); + seqCommand); sb.Append("\n"); }