From 0cc8e76d64f1429c7b9c8010b6d1d1dab6e03300 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 20 Mar 2020 23:11:16 -0400 Subject: [PATCH] CActorContraption: Make use of structured bindings where applicable Same behavior, but with better names than `first` or `second`. --- Runtime/MP1/World/CActorContraption.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Runtime/MP1/World/CActorContraption.cpp b/Runtime/MP1/World/CActorContraption.cpp index 374d824e3..656b8c6f7 100644 --- a/Runtime/MP1/World/CActorContraption.cpp +++ b/Runtime/MP1/World/CActorContraption.cpp @@ -53,11 +53,12 @@ void MP1::CActorContraption::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId void MP1::CActorContraption::Think(float dt, CStateManager& mgr) { CScriptActor::Think(dt, mgr); - for (const std::pair& uid : x2e8_children) { - CFlameThrower* act = static_cast(mgr.ObjectById(uid.first)); + for (const auto& [uid, name] : x2e8_children) { + auto* act = static_cast(mgr.ObjectById(uid)); - if (act && act->GetActive()) - act->SetTransform(x34_transform * GetScaledLocatorTransform(uid.second), dt); + if (act && act->GetActive()) { + act->SetTransform(x34_transform * GetScaledLocatorTransform(name), dt); + } } }